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

[docs] Regenerate command auto-docs #266

Closed
wants to merge 2 commits into from
Closed

Conversation

shish
Copy link
Contributor

@shish shish commented Nov 24, 2022

Stack created with [Sapling]

[docs] Regenerate command auto-docs

Summary: I want to add syntax highlighting to the auto-generated docs, but they are out of date, so first let's update them

Test Plan:

Summary: Right now the example sl sessions have no hightlighting, or sometimes they pretend to be bash, which kind-of-half-works but also half doesn't work and is ugly (See the "Before" example - there is random highlighting for some numbers in the middle of command output, the ".." in "..." is randomly highlighted as a directory, etc)

This diff adds a new custom Prism language called "sl-shell-example" which does syntax highlighting specifically tailored for our example sessions with these main parts:

```
# comment
$ shell command
~/my/subdir $ shell command in a specific subdirectory
output
```

<img width="495" alt="Screenshot 2022-11-24 at 16 15 08" src="https://user-images.githubusercontent.com/40659/203828858-592f3bbd-27bb-42c5-a762-881baed3ac21.png">

(For the record, Prism already has a language called "shell-session", but that language doesn't support comments (which is something we make heavy use of), and also it tries to be clever by highlighting random words in the middle of shell commands (which is just distracting in the context of sapling docs))

Test Plan:

Before:
<img width="667" alt="Screenshot 2022-11-24 at 15 54 27" src="https://user-images.githubusercontent.com/40659/203827808-2dd856ef-4a94-4afe-ac79-f053925f3e59.png">

After:
<img width="668" alt="Screenshot 2022-11-24 at 15 54 39" src="https://user-images.githubusercontent.com/40659/203827793-3d1cee6b-0c68-4a99-9db9-821162db530e.png">
Summary: I want to add syntax highlighting to the auto-generated docs, but they are out of date, so first let's update them

Test Plan:
@facebook-github-bot
Copy link
Contributor

@sggutier has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Dec 1, 2022
Summary:
Stack created with [Sapling]
* #270
* __->__ #267
* #266
* #264

[docs] syntax-highlighting for smartlogs

This doesn't work in all cases (trying to come with with a regex that correctly handles practically arbitrary input never will) - but it seems to cover the majority of examples that are in the docs in practice.

Notable omissions:
- non-active local bookmarks aren't spotted
- no differentiation between draft and public commits

Example:
{F806537223}

Pull Request resolved: #267

Test Plan: Looked through all of the pages manually

Reviewed By: quark-zju

Differential Revision: D41544319

Pulled By: shish

fbshipit-source-id: 1a3bf691a5f53de90c4bb36a4c2613cf1a5edb0c
facebook-github-bot pushed a commit that referenced this pull request Dec 6, 2022
Summary:
Stack created with [Sapling]
* __->__ #269
* #267
* #266
* #264

[docs] make examples consistent

 both human understanding and syntax highlighting work better when the examples are consistent :)

Pull Request resolved: #269

Test Plan: manually looked through every page

Reviewed By: bolinfest

Differential Revision: D41544321

Pulled By: shish

fbshipit-source-id: aca88968b1c6cfc5340a004dd115e9eabbd4313c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants