GithubHelp home page GithubHelp logo

happy-ferret / cargo-external-doc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geal/cargo-external-doc

0.0 2.0 0.0 7 KB

integrate markdown files with your rustdoc generated documentation

License: MIT License

Rust 65.22% HTML 34.78%

cargo-external-doc's Introduction

cargo external-doc

This tool allows you to add markdown files to your crate's documentation generated with rustdoc.

The documentation generated by rustdoc is meant for code and API references, and does not offer a nice way to add long form documentation. This tool will fix that until rustlang/cargo#739 is implemented.

Installation

cargo external-doc is installed via cargo install:

$ cargo install cargo-external-doc

Usage

Put your articles written in markdown in the doc/ subfolder of your project (see nom for an example).

rustdoc requires that the files are prefixed with a title like this:

% Your title here

Now, run cargo build then cargo external-doc. This tool will:

  • call cargo doc
  • test the code examples in the files from doc/
  • generate html files consistent with rustdoc's templates and put them in target/doc/your_crate

Your other documentation files can reference it by relative URL, like this for a doc/guide.md file:

cf the [guide](guide.html)

Example

In nom, you can see:

Caveats

This tool is a temporary solution, until something better is integrated in cargo doc.

It does not support overriding values like the target path.

It relies on the target/debug/libyourcrate.rlib file existing.

It does not check for invalid links.

It is not configurable.

It fits a need I have for nom, and it might not fit what you want. I'm open to modification ideas and patches, but I'd prefer to see it implemented correctly in cargo doc instead.

cargo-external-doc's People

Contributors

geal avatar mathstuf avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.