From: Ralf Jung Date: Mon, 8 Jun 2015 19:43:02 +0000 (+0200) Subject: switch from pycco and md to docco and rst X-Git-Url: https://git.ralfj.de/rust-101.git/commitdiff_plain/ae22b72e84239a39978aed2cf329f52c86711aa9 switch from pycco and md to docco and rst --- diff --git a/.gitignore b/.gitignore index 7bac8aa..bdde55a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ target docs +sync-docs diff --git a/README.md b/README.md deleted file mode 100644 index 406acad..0000000 --- a/README.md +++ /dev/null @@ -1,7 +0,0 @@ -Rust-101 -======== - -This is Rust-101, a tutorial for the [Rust language](http://www.rust-lang.org/). -You can either read through the sources in `src/`, or generate the HTML -in `docs/` using `./pycco-rs src/*.rs`, or go directly to -[the rendered output](https://ralfjung.github.io/rust-101/main.html). diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..ae56d3f --- /dev/null +++ b/README.rst @@ -0,0 +1,10 @@ +Rust-101 +======== + +This is Rust-101, a tutorial for the `Rust language`_. You can either read +through the sources in ``src/``, or generate the HTML in ``docs/`` using ``docco +src/*.rs`` (this step needs Docco_), or go directly to `the rendered output`_. + +.. _Rust language: http://www.rust-lang.org/ +.. _Docco: https://jashkenas.github.io/docco/ +.. _the rendered output: https://ralfjung.github.io/rust-101/main.html diff --git a/push-docs b/push-docs deleted file mode 100755 index 8f86eed..0000000 --- a/push-docs +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e - -cd "$(dirname "$0")" -./pycco-rs src/*.rs -cd docs -git add . -git commit -m "semi-auto-update of the documentation" -git push diff --git a/pycco-rs b/pycco-rs deleted file mode 100755 index e6199d9..0000000 --- a/pycco-rs +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/python -# A little wrapper around pycco, to add Rust support. -import pycco -from pygments import lexers, formatters -import re -pycco.main.languages[".rs"] = { "name": "rust", "symbol": "//"} - -# need to re-build this stuff... -for ext, l in pycco.main.languages.items(): - # Does the line begin with a comment? - l["comment_matcher"] = re.compile(r"^\s*" + l["symbol"] + "\s?") - # The dividing token we feed into Pygments, to delimit the boundaries between - # sections. - l["divider_text"] = "\n" + l["symbol"] + "DIVIDER\n" - # The mirror of `divider_text` that we expect Pygments to return. We can split - # on this to recover the original sections. - l["divider_html"] = re.compile(r'\n*' + l["symbol"] + 'DIVIDER\n*') - # Get the Pygments Lexer for this language. - l["lexer"] = lexers.get_lexer_by_name(l["name"]) - -pycco.main.main() diff --git a/src/main.rs b/src/main.rs index c2d9486..51de479 100644 --- a/src/main.rs +++ b/src/main.rs @@ -51,3 +51,5 @@ fn main() { // * [The Rust Book](https://doc.rust-lang.org/stable/book/) // * [Rust by Example](http://rustbyexample.com/) // * The [Rust Subreddit](https://www.reddit.com/r/rust/) + +// (This website has been generated with [Docco](https://jashkenas.github.io/docco/))