docs: colorize smartlog example

Summary: Colorize the smartlog example so it matches terminal output.

Reviewed By: quark-zju

Differential Revision: D41314885

fbshipit-source-id: 7d85517b8acf7596a35133b0429c91b5b2ca4464
This commit is contained in:
Mark Juggurnauth-Thomas 2022-11-16 16:01:46 -08:00 committed by Facebook GitHub Bot
parent e68cdbba95
commit c96ad3c5cc
2 changed files with 75 additions and 43 deletions

View File

@ -19,52 +19,50 @@ It shows you:
Smartlog provides you with a succinct view of your work by hiding all commits that arent relevant to you. In the example below, the dashed line on the left represents the main branch and elides thousands of commits to show you just the ones relevant to you. Smartlog provides you with a succinct view of your work by hiding all commits that arent relevant to you. In the example below, the dashed line on the left represents the main branch and elides thousands of commits to show you just the ones relevant to you.
Smartlog can be run via `sl smartlog` or by just running `sl`. Smartlog can be displayed via `sl smartlog` or by just running `sl`.
```bash <pre>
$ sl <span class="shell-prompt">&gt;</span> <span class="shell-command">sl</span><br />
o 5abffb82f Wednesday at 09:39 remote/main o <span class="sl-public">5abffb82f</span> Wednesday at 09:39 <span class="sl-bookmark">remote/main</span><br />
<br />
╷ o 824cbba75 13 minutes ago mary ╷ o <span class="sl-draft">824cbba75</span> 13 minutes ago mary<br />
╷ │ [eden] Support long paths in Windows FSCK ╷ │ [eden] Support long paths in Windows FSCK<br />
╷ │ ╷ │<br />
╷ │ o b3c03d03c Wednesday at 09:39 mary ╷ │ o <span class="sl-draft">b3c03d03c</span> Wednesday at 09:39 mary<br />
╷ ├─╯ temp ╷ ├─╯ temp<br />
╷ │ ╷ │<br />
╷ o 19340c083 Wednesday at 09:39 mary ╷ o <span class="sl-draft">19340c083</span> Wednesday at 09:39 mary<br />
╷ │ [eden] Close Windows file handle during Windows Fsck ╷ │ [eden] Close Windows file handle during Windows Fsck<br />
╷ │ ╷ │<br />
╷ o b52192598 Wednesday at 09:39 mary ╷ o <span class="sl-draft">b52192598</span> Wednesday at 09:39 mary <span class="sl-diff">#12</span><br />
╭─╯ [eden] Use PathMap for WindowsFsck ╭─╯ [eden] Use PathMap for WindowsFsck<br />
<br />
o 2ac18611a Wednesday at 05:00 remote/stable o <span class="sl-public">2ac18611a</span> Wednesday at 05:00 <span class="sl-bookmark">remote/stable</span><br />
<br />
╷ @ 0d49848b3 Tuesday at 11:48 mary ╷ @ <span class="sl-draft">0d49848b3</span> Tuesday at 11:48 mary<br />
╷ │ [edenfs] Recover Overlay from disk/scm for Windows fsck ╷ │ <span class="sl-current">[edenfs] Recover Overlay from disk/scm for Windows fsck</span><br />
╷ │ ╷ │<br />
╷ o 97f33204a Tuesday at 11:48 mary ╷ o <span class="sl-draft">97f33204a</span> Tuesday at 11:48 mary<br />
╷ │ [eden] Remove n^2 path comparisons from Windows fsck ╷ │ [eden] Remove n^2 path comparisons from Windows fsck<br />
╷ │ ╷ │<br />
╷ o 50dc055b9 Tuesday at 15:40 mary ╷ o <span class="sl-draft">50dc055b9</span> Tuesday at 15:40 mary<br />
╭─╯ [eden] Thread EdenConfig down to Windows fsck ╭─╯ [eden] Thread EdenConfig down to Windows fsck<br />
<br />
o 3dfc61ae2 Tuesday at 10:52 o <span class="sl-public">3dfc61ae2</span> Tuesday at 10:52<br />
<br />
╷ o 339f93673 Jul 15 at 11:12 mary ╷ o <span class="sl-draft">339f93673</span> Jul 15 at 11:12 mary<br />
╷ │ debug ╷ │ debug<br />
╷ │ ╷ │<br />
╷ x 2d4fbea60 [Landed as 04da3d3963ba] Jul 15 at 11:12 mary ╷ x 2d4fbea60 [Landed as 04da3d3963ba] Jul 15 at 11:12 mary <span class="sl-diff">#11</span><br />
╭─╯ [sl] windows: update Python ╭─╯ <span class="sl-obsolete">[sl] windows: update Python</span><br />
<br />
o a75ab860a Jul 15 at 07:59 o <span class="sl-public">a75ab860a</span> Jul 15 at 07:59<br />
<br />
~ ~<br />
``` </pre>
In an actual terminal it is color coded, making it easy to read at a glance.
### Interactive GUI smartlog ### Interactive GUI smartlog
An interactive smartlog GUI is available by running `sl web`. This shows similar information to `sl smartlog` while also refreshing automatically and allow you to run commands and drag and drop commits to rebase them. An interactive smartlog GUI is available by running `sl web`. This shows similar information to `sl smartlog` while also refreshing automatically, and allows you to run commands or drag and drop commits to rebase them.
[See Interactive Smartlog Documentation](../addons/isl.md) [See Interactive Smartlog Documentation](../addons/isl.md)

View File

@ -37,3 +37,37 @@
--ifm-color-primary-lighter: #32d8b4; --ifm-color-primary-lighter: #32d8b4;
--ifm-color-primary-lightest: #4fddbf; --ifm-color-primary-lightest: #4fddbf;
} }
.sl-public {
color: #dd0;
}
.sl-draft {
color: #ff0;
font-weight: bold;
}
.sl-bookmark {
color: #0d0;
}
.sl-diff {
color: #fff;
font-weight: bold;
}
.sl-current {
color: #d0d;
}
.sl-obsolete {
color: #888;
}
.shell-prompt {
color: #90ee90;
}
.shell-command {
font-weight: bold;
}