Example of automatic creating of tables of contents in groff
.NH
method
.XS \" index start
method contents
.XE \" end index
.LP| %rec: periodic_table | |
| %sort: AtomicNumber | |
| # all values came from | |
| # https://pubchem.ncbi.nlm.nih.gov/periodic-table/ | |
| AtomicNumber: 1 | |
| Symbol: H | |
| Name: Hydrogen | |
| AtomicMass: 1.0080 |
| fun! s:GroffConceal(group,pat,cchar) | |
| exe 'syn match '.a:group." '".a:pat."' contained conceal cchar=".a:cchar | |
| endfun | |
| if exists('g:groff_greek') | |
| call s:GroffConceal('roffGreek' ,'\<alpha\>' ,'α') | |
| call s:GroffConceal('roffGreek' ,'\<beta\>' ,'β') | |
| call s:GroffConceal('roffGreek' ,'\<gamma\>' ,'γ') | |
| call s:GroffConceal('roffGreek' ,'\<delta\>' ,'δ') | |
| call s:GroffConceal('roffGreek' ,'\<epsilon\>' ,'ϵ') |
| .\" cat THISFILE | tsql | tbl | groff -Tpdf > THISFILE.pdf | |
| Store info | |
| .sqldb :memory: | |
| .sqlbeg | |
| create table Fam ( | |
| name text, | |
| id integer | |
| primary key |
| .ft CW | |
| groff -G -ms -Tpdf grap.ms > grap.pdf | |
| .ft | |
| .NH | |
| Simple example | |
| .LP | |
| .G1 | |
| 54.2 | |
| 49.4 |
| .defcolor LOCALBLUE rgb 0.1 0.1 0.9 | |
| .de NOTE | |
| \m[LOCALBLUE]NOTE\m[]: \\$* | |
| .. | |
| .de PROOF | |
| .ft BI | |
| PROOF | |
| .ft | |
| .. | |
| .defcolor LOCALRED rgb 1 0.0 0.0 |
| import subprocess | |
| import os | |
| from qutebrowser.api import interceptor | |
| """ | |
| qutebrowser settings for video | |
| for more settings check out | |
| https://qutebrowser.org/doc/help/settings.html | |
| """ |
| ## HISTORY | |
| HISTFILE="${XDG_CACHE_HOME}/zsh_history" | |
| HISTSIZE=1000 | |
| SAVEHIST=1000 | |
| #go to the directory without using cd | |
| setopt autocd | |
| export NNN_OPENER='open' | |
| # Reclaim CTRL-S for use, e.g., with Vim (see: man stty) |