Skip to content

Change prompt symbol in comments from $ to %. Close #334.#335

Merged
japaric merged 0 commit into
rust-lang:masterfrom
dbbrian:master
Dec 24, 2014
Merged

Change prompt symbol in comments from $ to %. Close #334.#335
japaric merged 0 commit into
rust-lang:masterfrom
dbbrian:master

Conversation

@dbbrian

@dbbrian dbbrian commented Dec 17, 2014

Copy link
Copy Markdown
Contributor

Kramed, gitbook’s Markdown parser, see the dollar signs in the comments of fs.rs as MathJax delimiters:

// A simple implementation of `$ cat path`

// A simple implementation of `$ echo s > path`

// A simple implementation of `$ touch path` (ignores existing files)

Disabling MathJax, as it is not used, in book.json as mentionned here...

{
    "plugins": ["-mathjax", "rust-playpen"],
    "pluginsConfig": {
        "rust-playpen": {}
    }
}

...don’t work. The library is not loaded anymore, but the setting is not passed to kramed. Disabling MathJax by hand in kramed.js does, but is obviously impractical, and dirty.

MathJax does allow to change delimiters but the $$ pattern is hard-coded in a regex inside kramed.js.

I suggest we just change the $s to #s. That way we’ll keep the semantic that code in comments are inside backticks, which is good, and used in other examples.

@dbbrian dbbrian changed the title Change prompt symbol in comments from $ to #. Fix #334. Change prompt symbol in comments from $ to #. Close #334. Dec 17, 2014
@steveklabnik

Copy link
Copy Markdown
Contributor

Historically, # foo means "run foo as root.' So I'm not sure this is a good fix.

@dbbrian

dbbrian commented Dec 17, 2014

Copy link
Copy Markdown
Contributor Author

Yes, I had mixed feelings about that, but I thought that was ok giving the context.

@tomjakubowski

Copy link
Copy Markdown
Contributor

% is another relatively common prompt character.

@dbbrian

dbbrian commented Dec 17, 2014

Copy link
Copy Markdown
Contributor Author

@tomjakubowski Of course! All this JavaScript digging softened my brain… Thanks!

@dbbrian

dbbrian commented Dec 19, 2014

Copy link
Copy Markdown
Contributor Author

@steveklabnik Is it ok for you if I close this one and submit another with %?

@steveklabnik

Copy link
Copy Markdown
Contributor

You don't need to close, just force push to your master branch

@dbbrian

dbbrian commented Dec 19, 2014

Copy link
Copy Markdown
Contributor Author

Done! (thanks!)

@dbbrian dbbrian changed the title Change prompt symbol in comments from $ to #. Close #334. Change prompt symbol in comments from $ to %. Close #334. Dec 21, 2014
@japaric japaric merged commit 6577e7f into rust-lang:master Dec 24, 2014
@tomjakubowski

Copy link
Copy Markdown
Contributor

What happened in this PR? The "files changed" tab is now empty and a no-op was merged by hand into master or something?

@japaric

japaric commented Dec 24, 2014

Copy link
Copy Markdown

was merged by hand into master or something?

No, it wasn't. If you look the latest commits, the last action was me merging #340 via the web interface.

What happened in this PR?

I have no idea. It seems that for some reason (quantum entanglement? :P) when I merged #340, this one got closed (well, merged as a no-op) at the same time.

@dbbrian Could you please send a new PR? Preferably from a different branch.

@dbbrian

dbbrian commented Dec 24, 2014

Copy link
Copy Markdown
Contributor Author

Done. I probably --forced too much on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants