Coder Social home page Coder Social logo

Comments (10)

mgeisler avatar mgeisler commented on August 25, 2024 1

Yeah, that's definitely an annoyance. It's reported upstream here: rust-lang/mdBook#864.

People tried to fix it repeatedly: #25 and #29. So we should probably do something about it...

My idea would be to fix it upstream, but I haven't taken the time to do that.

from comprehensive-rust.

mgeisler avatar mgeisler commented on August 25, 2024 1

Fixed via #951.

from comprehensive-rust.

sharunkumar avatar sharunkumar commented on August 25, 2024 1

We could separate the output from the shell commands (like you did in your PRs)

@mgeisler when doing this, the test build fails on the PR

I noticed this when I tried it in the previous PR itself, not sure how to fix it

Update: figured it out, had to specify the language for the new code block

from comprehensive-rust.

gendx avatar gendx commented on August 25, 2024

Glad to see it's already reported upstream :)

from comprehensive-rust.

mgeisler avatar mgeisler commented on August 25, 2024

Our style guide actually talks about this: https://developers.google.com/style/code-syntax#prompt.

The system used there knows to not copy the $, even for examples that contain multiple commands. I think we should enhance mdbook with a similar capability.

from comprehensive-rust.

mgeisler avatar mgeisler commented on August 25, 2024

If mdbook ever gets support for not copying the prompt, then we can consider adding the prompts back. For now, it's probably better to remove them since this has been suggested repeatedly 😄

from comprehensive-rust.

mgeisler avatar mgeisler commented on August 25, 2024

Hi @sharunkumar, thanks for tackling this. There is a final place where we have a $ infront of the shell commands: build_all.sh. These dollar signs show up in the Android section.

We should fix those too to make things consistent. Right now, we include the commands from the shell script and hard-code the output. So the Markdown on the page linked above looks like this:

```shell
{{#include ../build_all.sh:hello_rust}}
Hello from Rust!
```

We could separate the output from the shell commands (like you did in your PRs).

from comprehensive-rust.

sharunkumar avatar sharunkumar commented on August 25, 2024

Oh alright I could check it out

from comprehensive-rust.

sharunkumar avatar sharunkumar commented on August 25, 2024

Idk if its because I'm running it from windows but when I run mdbook serve this is what that page looks like on localhost, after the changes:

image

Update: looks good on WSL though, but not sure why it looks the way it does when serving from windows 🤔

from comprehensive-rust.

mgeisler avatar mgeisler commented on August 25, 2024

We could separate the output from the shell commands (like you did in your PRs)

@mgeisler when doing this, the test build fails on the PR

I noticed this when I tried it in the previous PR itself, not sure how to fix it

Update: figured it out, had to specify the language for the new code block

Great that you figured it out — the error looks very mysterious at first! 😄

from comprehensive-rust.

Related Issues (20)

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.