Add gnuplot documentation as source

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
pull/1126/head
Cimbali 6 years ago
parent 58c44bf332
commit f5a3152bbb

@ -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.',

@ -60,6 +60,7 @@
'pages/github',
'pages/go',
'pages/graphite',
'pages/gnuplot',
'pages/haskell',
'pages/jekyll',
'pages/jquery',

@ -0,0 +1,6 @@
._gnuplot {
.CENTER {
text-align: center;
}
@extend %simple;
}

@ -0,0 +1,61 @@
module Docs
class Gnuplot
class CleanHtmlFilter < Filter
def call
# remove some anchors nested inside headers: <hX><a name="">...</a></hX>
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):
# <B>{text} (p.&nbsp;<A HREF="{target}"><IMG ALT="[*]" SRC="crossref.png"></A>)<A NAME="{anchor}"></A></B>
# transform to <b><a href="{target}>{text}</a></b>
css('b:contains(" (p. ")').each do |node|
text = node.content.gsub /\(p\. (\[\*\])?\)/, ''
link = node.css('a[href]')[0]
if link
link.content = text.strip
node.children.each do |child|
child.remove if child != link
end
else
node.content = text.strip
end
end
doc
end
end
end
end

@ -0,0 +1,73 @@
module Docs
class Gnuplot
PROMOTE = {'Expressions' => 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

@ -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<br>
Distributed under the <a href="https://sourceforge.net/p/gnuplot/gnuplot-main/ci/master/tree/Copyright">gnuplot license</a> (rights to distribute modified versions are withheld).
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1 @@
https://sourceforge.net/p/gnuplot/gnuplot-main/ci/master/tree/demo/html/favicon.ico
Loading…
Cancel
Save