From f5a3152bbba69c7be1a6f84af11645c1bb022669 Mon Sep 17 00:00:00 2001 From: Cimbali Date: Thu, 23 May 2019 23:48:41 +0200 Subject: [PATCH] Add gnuplot documentation as source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documentation is part of the gnuplot source code, available at: - https://sourceforge.net/p/gnuplot/gnuplot-main/ci/master/tree/docs/ This can be redistributed, according the the Copyright (emphasis mine): > * Copyright 1986 - 1993, 1998, 2004 Thomas Williams, Colin Kelley > * > * Permission to use, copy, and distribute this software **and its** > * **documentation** for any purpose with or without fee is hereby granted, > * provided that the above copyright notice appear in all copies and > * that both that copyright notice and this permission notice appear > * in supporting documentation. Full copyright notice here: https://sourceforge.net/p/gnuplot/gnuplot-main/ci/master/tree/Copyright The term “gnuplot license” is not very widespread but brings satisfying results on search engines (including on wikipedia), so I took the liberty to add a link to the copyright file, taken from the “Gnuplot's copyright” link on the gnuplot home page, http://gnuplot.info. Here is how to build the gnuplot docs to parse them: mkdir gnuplot-src gnuplot-conf $DEVDOCS_ROOT/docs/gnuplot git clone -b 5.2.7 --depth 1 https://git.code.sf.net/p/gnuplot/gnuplot-main ./gnuplot-src cd gnuplot-src/ ./prepare cd ../gnuplot-conf ../gnuplot-src/configure make -C docs nofigures.tex latex2html -html 5.0,math -split 4 -link 8 -long_titles 5 -dir $DEVDOCS_ROOT/docs/gnuplot -ascii_mode docs/nofigures.tex --- .../templates/pages/about_tmpl.coffee | 5 ++ assets/stylesheets/application.css.scss | 1 + assets/stylesheets/pages/_gnuplot.scss | 6 ++ lib/docs/filters/gnuplot/clean_html.rb | 61 +++++++++++++++ lib/docs/filters/gnuplot/entries.rb | 73 ++++++++++++++++++ lib/docs/scrapers/gnuplot.rb | 41 ++++++++++ public/icons/docs/gnuplot/16.png | Bin 0 -> 2954 bytes public/icons/docs/gnuplot/16@2x.png | Bin 0 -> 2163 bytes public/icons/docs/gnuplot/SOURCE | 1 + 9 files changed, 188 insertions(+) create mode 100644 assets/stylesheets/pages/_gnuplot.scss create mode 100644 lib/docs/filters/gnuplot/clean_html.rb create mode 100644 lib/docs/filters/gnuplot/entries.rb create mode 100644 lib/docs/scrapers/gnuplot.rb create mode 100644 public/icons/docs/gnuplot/16.png create mode 100644 public/icons/docs/gnuplot/16@2x.png create mode 100644 public/icons/docs/gnuplot/SOURCE diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 0165ade2..60c74210 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -311,6 +311,11 @@ credits = [ 'Free Software Foundation', 'GFDL', 'https://www.gnu.org/licenses/fdl-1.3.en.html' + ], [ + 'Gnuplot', + 'Copyright 1986 - 1993, 1998, 2004 Thomas Williams, Colin Kelley', + 'gnuplot license', + 'https://sourceforge.net/p/gnuplot/gnuplot-main/ci/master/tree/Copyright' ], [ 'Go', 'Google, Inc.', diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 0072d511..1b1c3ad0 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -60,6 +60,7 @@ 'pages/github', 'pages/go', 'pages/graphite', + 'pages/gnuplot', 'pages/haskell', 'pages/jekyll', 'pages/jquery', diff --git a/assets/stylesheets/pages/_gnuplot.scss b/assets/stylesheets/pages/_gnuplot.scss new file mode 100644 index 00000000..b7d584e7 --- /dev/null +++ b/assets/stylesheets/pages/_gnuplot.scss @@ -0,0 +1,6 @@ +._gnuplot { + .CENTER { + text-align: center; + } + @extend %simple; +} diff --git a/lib/docs/filters/gnuplot/clean_html.rb b/lib/docs/filters/gnuplot/clean_html.rb new file mode 100644 index 00000000..e612982b --- /dev/null +++ b/lib/docs/filters/gnuplot/clean_html.rb @@ -0,0 +1,61 @@ +module Docs + class Gnuplot + class CleanHtmlFilter < Filter + def call + # remove some anchors nested inside headers: ... + css('h1, h2, h3, h4, h5').each do |heading| + anchor = heading.css('a')[0] + heading['id'] = anchor['id'] || anchor['name'] + heading.content = anchor.content.strip + end + + # make the title on the front page which is in some weird tags + if root_page? + title = css('.HUGE')[0] + title.name = 'h1' + + subtitle = css('.XLARGE')[0] + title.content = title.content + ' − ' + subtitle.content + + css('> *:first-child')[0].before(title) + subtitle.remove + + css('p:contains("TableOfContents")').remove + end + + # remove nav, empty items, and any useless horizontal rules as well + # as the subsection table of contents (.ChildLinks) + css('.navigation').remove + css('#CHILD_LINKS, ul.ChildLinks').remove + css('hr').remove + # Anchors that use only names are some numerical IDs that latex2html distributes through the document + css('a[name]:not([href]):not([id])').remove + + # spacing + css('> div, p').each do |node| + node.remove if node.content.strip.empty? + end + + # links generated are of the form (NB: some might have been removed): + # {text} (p. [*]) + # transform to nil, 'Linetypes, colors, and styles' => nil, 'Fit' => nil, 'Format' => nil, + 'Plot' => nil, 'Splot' => nil, 'Style' => 'Plot appearance', + 'Set-show' => 'Set / Show', 'Datafile' => nil, 'Key' => 'Legend'} + NOREPEAT = ['String constants, string variables, and string functions', 'Substitution and Command line macros'] + + class EntriesFilter < Docs::EntriesFilter + def initialize(*) + super + end + + def get_name + return 'Stats' if slug.downcase == 'stats_statistical_summary' + return css('h1')[0].content.strip + end + + def get_type + return (PROMOTE[name] || name) if PROMOTE.include? name + + parent = at_css('.navigation > b:contains("Up:")').next_element.content + return 'Using Gnuplot' if parent == 'Gnuplot' + return parent + end + + def include_default_entry? + !root_page? and slug.downcase != 'complete_list_terminals' #and !PROMOTE.include? name + end + + def additional_entries + return [] if root_page? + entries = [] + + if slug.downcase == 'complete_list_terminals' + list_stack = [[css('ul.ChildLinks'), '', nil]] + else + list_stack = [[css('ul.ChildLinks'), name, nil]] + end + + while !list_stack.empty? + list, name_, type_ = list_stack.pop + list.css('> li').each do |item| + + sublists = item.css('> ul') + link = item.css('> a, span') + + if link.empty? + item_name = name_ + else + item_name = link[0].text.strip + item_name = "#{name_} #{item_name}".strip unless PROMOTE.include? name_ or NOREPEAT.include? name_ + item_name = item_name.sub /^(\w+) \1/, '\1' + item_name = 'set style boxplot' if slug.downcase == 'set_show' and item_name == 'Boxplot' + + if PROMOTE.include? name_ + type_ = PROMOTE[name_] || name_ + end + + entries << [item_name, link[0]['href'].split('#')[1], type_] + end + + list_stack.push([sublists, item_name, type_]) unless sublists.empty? + end + end + + return entries + end + + private + + end + end +end diff --git a/lib/docs/scrapers/gnuplot.rb b/lib/docs/scrapers/gnuplot.rb new file mode 100644 index 00000000..dc55edb7 --- /dev/null +++ b/lib/docs/scrapers/gnuplot.rb @@ -0,0 +1,41 @@ +module Docs + class Gnuplot < FileScraper + self.name = 'Gnuplot' + self.slug = 'gnuplot' + self.type = 'gnuplot' + self.links = { + home: 'http://gnuplot.sourceforge.net/' + } + + self.root_path = 'index.html' + + html_filters.push 'gnuplot/entries', 'gnuplot/clean_html' + + options[:skip_links] = false + + options[:skip] = %w( + Copyright.html + External_libraries.html + Known_limitations.html + Introduction.html + About_this_document.html + New_features.html + Differences_from_version_4.html + Seeking_assistance.html + Gnuplot.html + Deprecated_syntax.html + Demos_Online_Examples.html + Terminal_types.html + Plotting_styles.html + Commands.html + Contents.html + Bugs.html + ) + + options[:attribution] = <<-HTML + Copyright 1986 - 1993, 1998, 2004 Thomas Williams, Colin Kelley
+ Distributed under the
gnuplot license (rights to distribute modified versions are withheld). + HTML + + end +end diff --git a/public/icons/docs/gnuplot/16.png b/public/icons/docs/gnuplot/16.png new file mode 100644 index 0000000000000000000000000000000000000000..3db00280f941d049356226dc91b7aac54aa23f05 GIT binary patch literal 2954 zcmV;53w88~P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1bxk|Ze({O1&V1dw>?I6Tev26Oy%KtyI`)%0w) zO-5A)C%`u{7rA*J5JZeS zpJ^PrzCa#cFC?$>`c-aHQ$1M~UCpYH*Up4NS0hys(~&!!8=*5O@y#9muln-d*?yn< z1TcDlJ|;th9ozj)XD5agEL`yI&NnTI$C&YSegA-;vF{ju0Qih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<$g5z48 AIRF3v literal 0 HcmV?d00001 diff --git a/public/icons/docs/gnuplot/16@2x.png b/public/icons/docs/gnuplot/16@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..5985b7aa54132155b9e712e460720b4b955df8e7 GIT binary patch literal 2163 zcmV-(2#oiMP)EX>4Tx04R}tkv&MmKp2MKrbdj$A?7w5hF>;4=OwO}zIAQI0o!?cOliKjMg zgY!Odl$B+b_?&pmqze*1a$WKGjdRImf%lA>*~}bqlvpfvu+qV-Y-+@l#4%OVslSl( zSmnIMS*zAq>z@3D;ex)r#C2N3NMQkskSHSsHB?ZAjX3Q(DHbwxp7ik#xqgXU3b`s^ zG{~+W{11L-YZVg{UZ-#p=zejWj}aiW3pDGF^L^|%%@ZK_3|#4L|3(9t{v^HL z)?!CM|2A-O-PV*n;Bp5Td@^KHcBLRKp;!do&*+=-z`!lgyXxiEI>+e)kfp5BH^9Lm zFj}JCYd-Jp>CEllnpS>4jzn^@9KQ;q00006VoOIv0RI600RN!9r;`8x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru;|mK7As&LA&QAaU25?D4K~z}7#g}_fl-C)?f8Vzk zcF|o#*j zP^2PtGHHsTos5ZDk_@I86N_BrsuI|xab;ch#-9GM!h*YKw3+dp+1c+q=X>AxIq!MS zbIy@6Gc$$VZs$&zPNxH-(I|jB^3&_}LOF)!%$YM742E%Z$;rt8^!N8qLfzEV1VDCn zcGOWdH8pWA_7WSd)hLkpQ2h#bNy(G?-EKF_moEok9DvDW!e}%`1WZawn)IHKkPx+f z%%&US*q2d*(5iVxQNn}DtO$RNMl=4doQNzwK0YE~V`F2~L{qiznSGp2?I5Y1MDknG zX$&^rkO%U2Nvh*Bzu=gm33X7(j?NNdf~uQ4jgfF*U_eZ?F``^=Hk(b@Y_^E@Q^8iD z^*k={EEXGEUlUWA&1Mq~4GrTY{7x!xQ8;+gU&aVto^;Ho&@t~@`~KemhH+Ei-@--V zV4-|J&-Uiul7AS$S7&cIxsL$F{&G%>^Q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2%U}A%=t1AOy6WUB&3A3#Zc=4iKm3R6*#_nUj+fZlCat%jFu67hwt+yY+5jPJa=( p8{V-FA|>$zU9=YR6E67gP7ZQTF>002ovPDHLkV1gY3Bnbcj literal 0 HcmV?d00001 diff --git a/public/icons/docs/gnuplot/SOURCE b/public/icons/docs/gnuplot/SOURCE new file mode 100644 index 00000000..8acb1e8c --- /dev/null +++ b/public/icons/docs/gnuplot/SOURCE @@ -0,0 +1 @@ +https://sourceforge.net/p/gnuplot/gnuplot-main/ci/master/tree/demo/html/favicon.ico