From ae22b72e84239a39978aed2cf329f52c86711aa9 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 8 Jun 2015 21:43:02 +0200 Subject: [PATCH 1/1] switch from pycco and md to docco and rst --- .gitignore | 1 + README.md | 7 ------- README.rst | 10 ++++++++++ push-docs | 9 --------- pycco-rs | 21 --------------------- src/main.rs | 2 ++ 6 files changed, 13 insertions(+), 37 deletions(-) delete mode 100644 README.md create mode 100644 README.rst delete mode 100755 push-docs delete mode 100755 pycco-rs 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/)) -- 2.30.2