Commit e20e33e7 authored by Vincent Tam's avatar Vincent Tam

Support: server-side highlighting with pygments

parent fa2e9b12
Pipeline #29586778 passed with stages
in 1 minute and 53 seconds
......@@ -733,18 +733,18 @@ Take screeenshot of graphical desktop from TTY.
I've refined [Neroshan's command][askubu-xwd] on Ask Ubuntu into a shell script.
```bash
{{< highlight bash "linenos=inline">}}
#!/bin/sh
# screenshot.sh
# USAGE: ./screenshot.sh [file-name]
chvt 7 # On Xubuntu 18.04
#chvt 1 # On Ubuntu 18.04
chvt 7 # On Xubuntu 18.04
#chvt 1# On Ubuntu 18.04
DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 xwd -root -out ~/screenshot.xwd
convert ~/screenshot.xwd $1
rm ~/screenshot.xwd
chvt `tty | sed 's:/dev/tty::'`
```
{{</ highlight >}}
This script requires one single argument: output file name (_with extension
name_), which is passed to `$1`. The idea is simple.
......
......@@ -61,11 +61,19 @@ true`.
source code <i class="far fa-file-code" aria-hidden></i> and text files <i
class="far fa-file-alt" aria-hidden></i> unless necessary. (say, [Makefile])
Further reading <i class="fas fa-external-link-alt" aria-hidden></i>:
<i class="fas fa-external-link-alt" aria-hidden></i> Further reading:
1. [Changing Between Spaces and Tabs in Sublime Text][css-tricks]
2. [Gnulib manual § 1.4.2][gnu-no-tab]
#### ↵ Ensure an empty line at end of file
To avoid [_missing newline at EOL_][post_eol], one can add one simple line to the user preferences.
{{< highlight json >}}
"ensure_newline_at_eof_on_save": true
{{</ highlight >}}
#### <i class="fas fa-ruler-vertical" aria-hidden></i> Set vertical ruler
Thanks to
......@@ -101,6 +109,7 @@ highlighting, say
[css-tricks]: https://css-tricks.com/changing-spaces-tabs-sublime-text/
[Makefile]: https://www.gnu.org/software/make/manual/make.html#Rule-Introduction
[gnu-no-tab]: https://www.gnu.org/software/gnulib/manual/html_node/Indent-with-spaces-not-TABs.html
[post_eol]: /post/2018-09-05-missing-newline-at-eol.md
[icon_fonts]: https://packagecontrol.io/packages/Icon%20Fonts
[mdx]: https://packagecontrol.io/packages/Markdown%20Extended
[md]: https://daringfireball.net/projects/markdown/
......
......@@ -107,9 +107,8 @@ an _additional_ `--cached` flag needs to be passed to obtain this behavior.
#### Solution for my enhanced Hugo theme
I had taken special care with the assets in `static`: exclude this folder also.
However, I _couldn't_ think of a better solution _without_ diggincommand
deeper into "bash inside bash". Therefore, I resorted to a basic
solution.
However, I _couldn't_ think of a better solution _without_ digging deeper into
"bash inside bash". Therefore, I resorted to a basic solution.
1. First loop through all text files and perform necessary modifications.
......@@ -128,6 +127,19 @@ in `./static`.
right-hand side, one has to run the above commands a few times against
different subfolders to obtain the desired result.
### Prevent making the same mistake again
To err is human, but repeating the _same_ error _isn't_ wise. However, it's _inefficient_ to manually inspect the end of file for _each_ edited files.
$ for f in "$(git diff --name-only)"; do echo $f && tail -c 1 $f | od -c; done
To prevent making this mistake in [Sublime Text&nbsp;3][st3], I added one simple
line to the user preferences.
{{< highlight json >}}
"ensure_newline_at_eof_on_save": true
{{</ highlight >}}
[Vim]: http://www.vim.org
[st3]: https://www.sublimetext.com/3
[bot]: https://robots.thoughtbot.com/no-newline-at-end-of-file
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment