Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document built-in modules #465

Open
16 of 23 tasks
udoprog opened this issue Mar 25, 2023 · 0 comments
Open
16 of 23 tasks

Document built-in modules #465

udoprog opened this issue Mar 25, 2023 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@udoprog
Copy link
Collaborator

udoprog commented Mar 25, 2023

Since #464, native modules can now be documented.

Missing features:

  • Generating links from full rune paths.
  • Running documentation tests. This ensures that the documentation is correct and as a bonus ensures that public features are tested.

This is a tracking issue for modules and functions which are still lacking documentation.

  • ::std::any
  • ::std::bytes
  • ::std::char
  • ::std::cmp
  • ::std::collections
  • ::std::core
  • ::std::float
  • ::std::fmt
  • ::std::future
  • ::std::generator
  • ::std::int
  • ::std::io
  • ::std::iter
  • ::std::macros
  • ::std::mem (More associated documentation #474)
  • ::std::object
  • ::std::ops
  • ::std::option
  • ::std::result
  • ::std::stream
  • ::std::string
  • ::std::test
  • ::std::vec

Since many functions mimic what's available in Rust, documentation from there can be adapted for Rune, such as this example from is_alphabetic (see Rust version here). The appropriate licensing attribution will be added before this is released.

/// Returns `true` if this `char` has the `Alphabetic` property.
///
/// `Alphabetic` is described in Chapter 4 (Character Properties) of the [Unicode Standard] and
/// specified in the [Unicode Character Database][ucd] [`DerivedCoreProperties.txt`].
///
/// [Unicode Standard]: https://www.unicode.org/versions/latest/
/// [ucd]: https://www.unicode.org/reports/tr44/
/// [`DerivedCoreProperties.txt`]: https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt
///
/// # Examples
///
/// ```rune
/// assert!('a'.is_alphabetic());
/// assert!('京'.is_alphabetic());
///
/// let c = '💝';
/// // love is many things, but it is not alphabetic
/// assert!(!c.is_alphabetic());
/// ```
#[rune::function(instance)]
#[inline]
fn is_alphabetic(c: char) -> bool {
    char::is_alphabetic(c)
}

Future

  • Type and variant level documentation is not yet supported. But is expected to be produced through the Any derive.
  • Documentation for vm-accelerated functionality is still missing. Such as vector indexing. Once support for this is added, those will be added to this as well.
@udoprog udoprog added enhancement New feature or request help wanted Extra attention is needed labels Mar 25, 2023
@udoprog udoprog pinned this issue Mar 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant