Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing bash prompt #11

Open
jonocodes opened this issue Oct 5, 2017 · 5 comments
Open

Removing bash prompt #11

jonocodes opened this issue Oct 5, 2017 · 5 comments

Comments

@jonocodes
Copy link
Contributor

Something came up while working on PWDer. here is an idea. if a line in an input block starts with '$ ', then '$ ' would get removed before executing it. This way the markdown can follow the Docker/Arch documentation guidelines a little closer. https://docs.docker.com/opensource/doc-style/#code-and-ui-text-styling

For example if there is '$ docker ps' in the exec block, and it is clicked then 'docker ps' would be executed.

@marcosnils
Copy link
Contributor

hmm I not sure if I agree with the change, what if you want to execute something like $mybinary?
I prefer to be clear and make sure that the command will execute "as is" in the code block

@xetorthio
Copy link
Contributor

So we are talking about having an sdk for pwd and and sdk for the tutorials. The tutorials sdk manages the click event of the code snippets and passes them to the pwd sdk to exec on the instance.
I think this logic of removing the starting $ would be implemented on the tutorials sdk.

@marcosnils are you concerned that someone want to write a tutorial where he wants you to run:
$mybinary?
If that is the case, then following the guidelines he would have to put int the <code> tag:

<code>
$ $mybinary
</code>

Which is basically what you would see in your shell, right?

@marcosnils
Copy link
Contributor

@xetorthio makes sense.

Ok, if this is the "standard" way of defining terminal commands per the styling guides as @jonocodes mentioned, let's go ahead and make the changes 👍

@jonocodes
Copy link
Contributor Author

jonocodes commented Oct 5, 2017

My proposal is to remove only '$ ' (note the space) if it is at the beginning of a line. A space following the dollar would be required if it were to be removed. Here is an example

$ ping google.com
$mybinary
 $ ping google.com

would be interpreted and executed as

ping google.com
$mybinary
 $ ping google.com

The space before the $ might need to be discussed more though. Maybe its ok to strip it actually.

Also good to think about how to deal with '# ' lines. Guidelines say this should be interpreted as a root operation. I know those get confused with comments, but I think in this case its not ambiguous.

@jonocodes
Copy link
Contributor Author

I can take a stab at implementing this, but I'll wait for a little more discussion on the proposal.

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

No branches or pull requests

3 participants