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

Add std implementation links to docs #8

Open
emesare opened this issue Nov 2, 2022 · 1 comment
Open

Add std implementation links to docs #8

emesare opened this issue Nov 2, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@emesare
Copy link
Member

emesare commented Nov 2, 2022

It would be nice to have links to every rust std api used directly within the docs for the api.

For example:

rhai-fs/src/path.rs

Lines 14 to 22 in 896ea06

/// Returns path to current working directory.
///
/// Throws an exception when:
/// - The current working directory does not exist.
/// - The process lacks the permissions to access the current working directory.
#[rhai_fn(return_raw)]
pub fn cwd() -> Result<std::path::PathBuf, Box<EvalAltResult>> {
std::env::current_dir().map_err(|e| e.to_string().into())
}

Becomes:

/// Returns path to current working directory. 
/// 
/// Throws an exception when: 
/// - The current working directory does not exist. 
/// - The process lacks the permissions to access the current working directory. 
///
/// See [std::env::current_dir](https://doc.rust-lang.org/std/env/fn.current_dir.html) for more information.
#[rhai_fn(return_raw)] 
pub fn cwd() -> Result<std::path::PathBuf, Box<EvalAltResult>> { 
   std::env::current_dir().map_err(|e| e.to_string().into()) 
} 
@emesare emesare added documentation Improvements or additions to documentation good first issue Good for newcomers labels Nov 2, 2022
@emesare emesare pinned this issue Nov 2, 2022
@emesare
Copy link
Member Author

emesare commented Dec 3, 2022

related: #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant