From f48c7132553d667d08cb425102ff9f01d396c775 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Mon, 25 Oct 2021 14:07:51 +0200 Subject: [PATCH] Add Debian testing man pages --- assets/stylesheets/application.css.scss | 1 + assets/stylesheets/pages/_man.scss | 75 ++++++++++++++++++++++++ lib/docs/filters/man/clean_html.rb | 10 ++++ lib/docs/filters/man/entries.rb | 17 ++++++ lib/docs/scrapers/man.rb | 21 +++++++ public/icons/docs/man/16.png | Bin 0 -> 720 bytes public/icons/docs/man/16@2x.png | Bin 0 -> 378 bytes public/icons/docs/man/SOURCE | 1 + 8 files changed, 125 insertions(+) create mode 100644 assets/stylesheets/pages/_man.scss create mode 100644 lib/docs/filters/man/clean_html.rb create mode 100644 lib/docs/filters/man/entries.rb create mode 100644 lib/docs/scrapers/man.rb create mode 100644 public/icons/docs/man/16.png create mode 100644 public/icons/docs/man/16@2x.png create mode 100644 public/icons/docs/man/SOURCE diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 0243afeb..fbd30021 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -76,6 +76,7 @@ 'pages/liquid', 'pages/love', 'pages/lua', + 'pages/man', 'pages/mariadb', 'pages/mdn', 'pages/meteor', diff --git a/assets/stylesheets/pages/_man.scss b/assets/stylesheets/pages/_man.scss new file mode 100644 index 00000000..40bc3132 --- /dev/null +++ b/assets/stylesheets/pages/_man.scss @@ -0,0 +1,75 @@ +._man { + .mandoc { + @extend %code; + white-space: unset; + } + + // from https://manpages.debian.org/testing/darktable/darktable.1.en.html + .Bd-indent { + margin-left: 3.8em; + } + + .Bl-bullet { + list-style-type: disc; + padding-left: 1em; + } + .Bl-dash { + list-style-type: none; + padding-left: 0em; + } + .Bl-dash > li:before { + content: "\2014 "; + } + .Bl-item { + list-style-type: none; + padding-left: 0em; + } + .Bl-compact > li { + margin-top: 0em; + } + + .Bl-enum { + padding-left: 2em; + } + .Bl-compact > li { + margin-top: 0em; + } + + .Bl-diag > dt { + font-style: normal; + font-weight: bold; + } + .Bl-diag > dd { + margin-left: 0em; + } + .Bl-hang > dd { + margin-left: 5.5em; + } + .Bl-inset > dd { + margin-left: 0em; + } + .Bl-ohang > dd { + margin-left: 0em; + } + .Bl-tag { + margin-left: 5.5em; + } + .Bl-tag > dt { + float: left; + margin-top: 0em; + margin-left: -5.5em; + padding-right: 1.2em; + vertical-align: top; + } + .Bl-tag > dd { + clear: right; + width: 100%; + margin-top: 0em; + margin-left: 0em; + vertical-align: top; + overflow: auto; + } + .Bl-compact > dt { + margin-top: 0em; + } +} diff --git a/lib/docs/filters/man/clean_html.rb b/lib/docs/filters/man/clean_html.rb new file mode 100644 index 00000000..90ae0c90 --- /dev/null +++ b/lib/docs/filters/man/clean_html.rb @@ -0,0 +1,10 @@ +module Docs + class Man + class CleanHtmlFilter < Filter + def call + css('.anchor', '.panels', '.paneljump', 'table.head').remove + doc + end + end + end +end diff --git a/lib/docs/filters/man/entries.rb b/lib/docs/filters/man/entries.rb new file mode 100644 index 00000000..dc4d3371 --- /dev/null +++ b/lib/docs/filters/man/entries.rb @@ -0,0 +1,17 @@ +module Docs + class Man + class EntriesFilter < Docs::EntriesFilter + def get_name + if slug.match?(/[1-9].en$/) + doc.document.title.split('—').first.strip + else + slug.split('/').first + end + end + + def get_type + slug.split('/').first + end + end + end +end diff --git a/lib/docs/scrapers/man.rb b/lib/docs/scrapers/man.rb new file mode 100644 index 00000000..5df3bc0f --- /dev/null +++ b/lib/docs/scrapers/man.rb @@ -0,0 +1,21 @@ +module Docs + class Man < UrlScraper + self.name = 'Debian man pages' + self.slug = 'man' + self.type = 'man' + self.base_url = 'https://manpages.debian.org/testing/' + self.links = { + home: 'https://manpages.debian.org/', + code: 'https://github.com/Debian/debiman/' + } + + html_filters.push 'man/entries', 'man/clean_html', 'title' + + options[:container] = '#content' + options[:skip_patterns] = [/src:/, /en.gz$/, /[1-9]$/, /^lib/] + + options[:attribution] = <<-HTML + Debian Manpages generated using https://github.com/Debian/debiman/ + HTML + end +end diff --git a/public/icons/docs/man/16.png b/public/icons/docs/man/16.png new file mode 100644 index 0000000000000000000000000000000000000000..2fc1c045f40f0d209de7293d30b56a6b06f73543 GIT binary patch literal 720 zcmV;>0x$iEP)A?0lxHBf7u5lcsM6r8lC)DhG$H4ToLX^vEgNlamLg-C)l2ju6g{+h7|+Slp!Kx(TI>JTzxQSXOF<0dDy?}$ zhIJumxXVRNy#`ou5x*hgxjYnb0RV7-I{?@Z#kKO@r)V^%>@iiftz8NC*I9RlQz!hN0RRy>U63fQ zA2@Tq)QXUwwtzV8a#1HVy9K}4!wx_R076jA3%fd&7Ao(C%T4o*-I;cEB3ZZiS)7hS zl>ji7U(qebXT0R$d12O4e;oiObE?yZ;?n7T%_Bwz%rNzg5S&00X=x!+?p?_P&3IOY zAnoVM@2NlCY4PFojE61IK+~4Sav3n4ak==_{wRWUDFB8H=C*cVleGU*C2U+M>p2Pl zwqps4Q?;#8GGH<}ujFlX22l;?0RY6cY<`nuS`-VLQ~=;G=6cPZOELpM2aaopvu=MU zB6%35@~;&32PYDtK`9l6GD{o8X!8ehaLUiQm$U#dTKO<}#B__Mi<@)+K+MuB%%w2i zJqKgHJ_WW*(2uqEeMNtbU5qyV==Du38AxH;2Mq-SGv&=H03eoib3WnHxx05nj&o2I zIV~HN5@@2RQ9EV4$&OvEj+b&&Cn{w76w0^*0Ke^o&bCz}N>E~1H`$`pOXMm~ULGvq z1_1s041;|>XKMjqJ|KIY3^LUzRuwKI%QwnF)y8=S8s(a)PO++J1?2bda_QTf&@Aja zZDD~m|0R|odcACOJfbLj@Z`02M{3?h;u@6y()^kVb0-jjiQ9{~~w50Vae2OB+cF$Jt0gBp?>-EMS%q zpFZGl0k+OYf|%xz$s!&&)1wBp(_AAw1-!Suw@6^;9DJ~zr7mpXBg(EzhQIDC%mOd{ zfsHmrOkHddlazw10cbfvMkx`KfPB$wYO8<+$QhV58?G6!6yI`IyL%F7mf)iN7C2%O z>|-t2&H(!exb(p}P#=Lt{q-A*KxwY70;yU*r`JQ^lLpLT)>8J{Hw|Z?oS?RHxAj;RH7V%FIQ8`8ff%dT(d*q<4wwEO32GFA{I7yK_#QHnP8; zBm8(1&Ul7Rc}m?PP*M5sNvzI-XDWW(mS^F=NKASk-XpO(6DrK**-#>DN${}|>E18- Y12(T2Skq*IyZ`_I07*qoM6N<$f>S-B%>V!Z literal 0 HcmV?d00001 diff --git a/public/icons/docs/man/SOURCE b/public/icons/docs/man/SOURCE new file mode 100644 index 00000000..aec07b6d --- /dev/null +++ b/public/icons/docs/man/SOURCE @@ -0,0 +1 @@ +https://manpages.debian.org/favicon.ico