[devdocsgjs/main: 1069/1867] Add styles for elisp docs and improve some html cleanups
- From: Andy Holmes <andyholmes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devdocsgjs/main: 1069/1867] Add styles for elisp docs and improve some html cleanups
- Date: Fri, 19 Nov 2021 23:47:41 +0000 (UTC)
commit f43b1f7b2d1195a4f6e979fc380e28a31005c846
Author: MasterEnoc <brianhernandez222 hotmail com>
Date: Wed Sep 9 00:08:16 2020 -0600
Add styles for elisp docs and improve some html cleanups
- Add elisp (emacs) images.
- Add elisp in about_tmpl.coffee file
- Add get_latest_version method to elisp.rb
- Add some cleanups to the html doc for style
purposes
- Add _elisp stylesheet
assets/javascripts/templates/pages/about_tmpl.coffee | 5 +++++
assets/stylesheets/application.css.scss | 1 +
assets/stylesheets/pages/_elisp.scss | 9 +++++++++
lib/docs/filters/elisp/clean_html.rb | 13 +++++++++++++
lib/docs/scrapers/elisp.rb | 5 +++++
public/icons/docs/elisp/16.png | Bin 0 -> 1426 bytes
public/icons/docs/elisp/16 2x png | Bin 0 -> 2905 bytes
public/icons/docs/elisp/SOURCE | 1 +
8 files changed, 34 insertions(+)
---
diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee
b/assets/javascripts/templates/pages/about_tmpl.coffee
index 8ac93ed4..fcb4ca50 100644
--- a/assets/javascripts/templates/pages/about_tmpl.coffee
+++ b/assets/javascripts/templates/pages/about_tmpl.coffee
@@ -261,6 +261,11 @@ credits = [
'2012 Plataformatec',
'Apache',
'https://raw.githubusercontent.com/elixir-lang/elixir/master/LICENSE'
+ ], [
+ 'Elisp',
+ '1990-1996, 1998-2019 Free Software Foundation, Inc.',
+ 'GPLv3',
+ 'https://www.gnu.org/licenses/gpl-3.0.html'
], [
'Ember.js',
'2017 Yehuda Katz, Tom Dale and Ember.js contributors',
diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss
index 1b1c3ad0..04c9ddb3 100644
--- a/assets/stylesheets/application.css.scss
+++ b/assets/stylesheets/application.css.scss
@@ -53,6 +53,7 @@
'pages/dojo',
'pages/drupal',
'pages/elixir',
+ 'pages/elisp',
'pages/ember',
'pages/erlang',
'pages/express',
diff --git a/assets/stylesheets/pages/_elisp.scss b/assets/stylesheets/pages/_elisp.scss
new file mode 100644
index 00000000..3b366005
--- /dev/null
+++ b/assets/stylesheets/pages/_elisp.scss
@@ -0,0 +1,9 @@
+._elisp {
+ div > b {
+ @extend %block-label, %label-blue;
+ }
+
+ div > b {
+ margin: 2% auto;
+ }
+}
diff --git a/lib/docs/filters/elisp/clean_html.rb b/lib/docs/filters/elisp/clean_html.rb
index 985191b2..7b4db744 100644
--- a/lib/docs/filters/elisp/clean_html.rb
+++ b/lib/docs/filters/elisp/clean_html.rb
@@ -47,8 +47,21 @@ module Docs
# add id to each defun section that contains a functions, macro, etc.
css('.defun').each do |node|
node['id']= node.first_element_child.content
+
+ # change all <var> tags to <b>, this helps pages style
+ functionName = node.first_element_child
+ arguments = functionName.next_sibling
+ arguments.parent= functionName
+ end
+
+ # remove br for style purposes
+ css('br').each do |node|
+ node.remove
end
+ # remove footnotes
+ css('.footnote').remove
+
doc
end
end
diff --git a/lib/docs/scrapers/elisp.rb b/lib/docs/scrapers/elisp.rb
index 0a103bdc..264ba6f5 100644
--- a/lib/docs/scrapers/elisp.rb
+++ b/lib/docs/scrapers/elisp.rb
@@ -61,5 +61,10 @@ module Docs
Licensed under the GNU GPL license.
HTML
+ def get_latest_version(opts)
+ body = fetch('https://www.gnu.org/software/emacs/manual/html_node/elisp/index.html', opts)
+ body.scan(/version \d*\.?\d*/)[0].sub('version', '')
+ end
+
end
end
diff --git a/public/icons/docs/elisp/16.png b/public/icons/docs/elisp/16.png
new file mode 100644
index 00000000..dc2d8ca8
Binary files /dev/null and b/public/icons/docs/elisp/16.png differ
diff --git a/public/icons/docs/elisp/16 2x png b/public/icons/docs/elisp/16 2x png
new file mode 100644
index 00000000..e68bf718
Binary files /dev/null and b/public/icons/docs/elisp/16 2x png differ
diff --git a/public/icons/docs/elisp/SOURCE b/public/icons/docs/elisp/SOURCE
new file mode 100644
index 00000000..6afbe82d
--- /dev/null
+++ b/public/icons/docs/elisp/SOURCE
@@ -0,0 +1 @@
+https://www.gnu.org/software/emacs/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]