metanorma-itu 1.0.11 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +10 -10
- data/.github/workflows/ubuntu.yml +25 -11
- data/.github/workflows/windows.yml +11 -12
- data/README.adoc +9 -49
- data/lib/asciidoctor/itu/biblio.rng +131 -46
- data/lib/asciidoctor/itu/cleanup.rb +90 -78
- data/lib/asciidoctor/itu/converter.rb +8 -12
- data/lib/asciidoctor/itu/front.rb +47 -18
- data/lib/asciidoctor/itu/isodoc.rng +32 -4
- data/lib/asciidoctor/itu/validate.rb +1 -1
- data/lib/isodoc/itu/base_convert.rb +9 -6
- data/lib/isodoc/itu/html/_coverpage.scss +1 -1
- data/lib/isodoc/itu/html/header.html +8 -8
- data/lib/isodoc/itu/html/html_itu_titlepage.html +5 -3
- data/lib/isodoc/itu/html/htmlstyle.scss +9 -5
- data/lib/isodoc/itu/html/itu.scss +24 -1
- data/lib/isodoc/itu/html/scripts.html +14 -27
- data/lib/isodoc/itu/html/word_itu_intro.html +2 -0
- data/lib/isodoc/itu/html/word_itu_titlepage.html +3 -3
- data/lib/isodoc/itu/html/wordstyle.scss +1 -1
- data/lib/isodoc/itu/html_convert.rb +3 -3
- data/lib/isodoc/itu/itu.recommendation-annex.xsl +3589 -0
- data/lib/isodoc/itu/itu.recommendation.xsl +3589 -0
- data/lib/isodoc/itu/itu.resolution.xsl +3589 -0
- data/lib/isodoc/itu/metadata.rb +6 -26
- data/lib/isodoc/itu/pdf_convert.rb +17 -44
- data/lib/isodoc/itu/ref.rb +26 -21
- data/lib/isodoc/itu/terms.rb +3 -4
- data/lib/isodoc/itu/word_convert.rb +5 -2
- data/lib/isodoc/itu/xref.rb +16 -12
- data/lib/metanorma/itu/processor.rb +8 -0
- data/lib/metanorma/itu/version.rb +1 -1
- metadata +5 -3
- data/lib/isodoc/itu/html/scripts.pdf.html +0 -72
data/lib/isodoc/itu/metadata.rb
CHANGED
@@ -8,17 +8,17 @@ module IsoDoc
|
|
8
8
|
super
|
9
9
|
here = File.dirname(__FILE__)
|
10
10
|
set(:logo_html,
|
11
|
-
#File.expand_path(File.join(here, "html", "Logo_ITU.jpg")))
|
12
11
|
File.expand_path(File.join(here, "html", "International_Telecommunication_Union_Logo.svg")))
|
13
12
|
set(:logo_comb,
|
14
13
|
File.expand_path(File.join(here, "html", "itu-document-comb.png")))
|
15
|
-
#set(:logo_word, File.expand_path(File.join(here, "html", "logo.png")))
|
16
14
|
set(:logo_word, File.expand_path(File.join(here, "html", "International_Telecommunication_Union_Logo.svg")))
|
17
15
|
end
|
18
16
|
|
19
17
|
def title(isoxml, _out)
|
20
|
-
main = isoxml&.at(ns("//bibdata/title[@language='
|
18
|
+
main = isoxml&.at(ns("//bibdata/title[@language='#{@lang}'][@type = 'main']"))&.text
|
21
19
|
set(:doctitle, main)
|
20
|
+
main = isoxml&.at(ns("//bibdata/title[@language='#{@lang}'][@type = 'subtitle']"))&.text
|
21
|
+
set(:docsubtitle, main)
|
22
22
|
series = isoxml&.at(ns("//bibdata/series[@type='main']/title"))&.text
|
23
23
|
set(:series, series)
|
24
24
|
series1 =
|
@@ -40,11 +40,12 @@ module IsoDoc
|
|
40
40
|
set(:bureau, bureau.text) if bureau
|
41
41
|
tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee"))
|
42
42
|
set(:tc, tc.text) if tc
|
43
|
+
super
|
43
44
|
end
|
44
45
|
|
45
46
|
def docid(isoxml, _out)
|
46
|
-
dn = isoxml.at(ns("//bibdata/docidentifier"))
|
47
|
-
set(:
|
47
|
+
dn = isoxml.at(ns("//bibdata/docidentifier[@type = 'ITU']"))
|
48
|
+
set(:docnumber, dn&.text)
|
48
49
|
dn = isoxml.at(ns("//bibdata/ext/structuredidentifier/annexid"))
|
49
50
|
oblig = isoxml&.at(ns("//annex/@obligation"))&.text
|
50
51
|
lbl = oblig == "informative" ? @labels["appendix"] : @labels["annex"]
|
@@ -55,27 +56,6 @@ module IsoDoc
|
|
55
56
|
%w(in-force-prepublished draft).include? status.downcase
|
56
57
|
end
|
57
58
|
|
58
|
-
def version(isoxml, _out)
|
59
|
-
super
|
60
|
-
revdate = get[:revdate]
|
61
|
-
set(:revdate_monthyear, monthyr(revdate))
|
62
|
-
end
|
63
|
-
|
64
|
-
MONTHS = {
|
65
|
-
"01": "January",
|
66
|
-
"02": "February",
|
67
|
-
"03": "March",
|
68
|
-
"04": "April",
|
69
|
-
"05": "May",
|
70
|
-
"06": "June",
|
71
|
-
"07": "July",
|
72
|
-
"08": "August",
|
73
|
-
"09": "September",
|
74
|
-
"10": "October",
|
75
|
-
"11": "November",
|
76
|
-
"12": "December",
|
77
|
-
}.freeze
|
78
|
-
|
79
59
|
def bibdate(isoxml, _out)
|
80
60
|
pubdate = isoxml.xpath(ns("//bibdata/date[@type = 'published']"))
|
81
61
|
pubdate and set(:pubdate_monthyear, monthyr(pubdate.text))
|
@@ -6,61 +6,34 @@ module IsoDoc
|
|
6
6
|
module ITU
|
7
7
|
# A {Converter} implementation that generates PDF HTML output, and a
|
8
8
|
# document schema encapsulation of the document for validation
|
9
|
-
class PdfConvert < IsoDoc::
|
9
|
+
class PdfConvert < IsoDoc::XslfoPdfConvert
|
10
10
|
def initialize(options)
|
11
11
|
@libdir = File.dirname(__FILE__)
|
12
12
|
@hierarchical_assets = options[:hierarchical_assets]
|
13
13
|
super
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
docxml
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Open Sans",sans-serif'),
|
23
|
-
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Open Sans",sans-serif'),
|
24
|
-
monospacefont: '"Space Mono",monospace'
|
25
|
-
}
|
26
|
-
end
|
27
|
-
|
28
|
-
def default_file_locations(_options)
|
29
|
-
{
|
30
|
-
htmlstylesheet: html_doc_path("htmlstyle.scss"),
|
31
|
-
htmlcoverpage: html_doc_path("html_itu_titlepage.html"),
|
32
|
-
htmlintropage: html_doc_path("html_itu_intro.html"),
|
33
|
-
scripts_pdf: html_doc_path("scripts.pdf.html"),
|
34
|
-
}
|
35
|
-
end
|
36
|
-
|
37
|
-
def googlefonts()
|
38
|
-
<<~HEAD.freeze
|
39
|
-
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,800|Space+Mono:400,700" rel="stylesheet">
|
40
|
-
HEAD
|
41
|
-
end
|
42
|
-
|
43
|
-
def make_body(xml, docxml)
|
44
|
-
body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
|
45
|
-
xml.body **body_attr do |body|
|
46
|
-
make_body1(body, docxml)
|
47
|
-
make_body2(body, docxml)
|
48
|
-
make_body3(body, docxml)
|
16
|
+
def pdf_stylesheet(docxml)
|
17
|
+
case doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
|
18
|
+
when "resolution" then "itu.resolution.xsl"
|
19
|
+
when "recommendation-annex" then "itu.recommendation-annex.xsl"
|
20
|
+
else
|
21
|
+
"itu.recommendation.xsl"
|
49
22
|
end
|
50
23
|
end
|
51
24
|
|
52
|
-
def
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
comments div3
|
25
|
+
def convert(filename, file = nil, debug = false)
|
26
|
+
file = File.read(filename, encoding: "utf-8") if file.nil?
|
27
|
+
docxml, outname_html, dir = convert_init(file, filename, debug)
|
28
|
+
/\.xml$/.match(filename) or
|
29
|
+
filename = Tempfile.open([outname_html, ".xml"], encoding: "utf-8") do |f|
|
30
|
+
f.write file
|
31
|
+
f.path
|
60
32
|
end
|
33
|
+
FileUtils.rm_rf dir
|
34
|
+
::Metanorma::Output::XslfoPdf.new.convert(
|
35
|
+
filename, outname_html + ".pdf", File.join(@libdir, pdf_stylesheet(docxml)))
|
61
36
|
end
|
62
|
-
|
63
|
-
include BaseConvert
|
64
37
|
end
|
65
38
|
end
|
66
39
|
end
|
data/lib/isodoc/itu/ref.rb
CHANGED
@@ -6,7 +6,7 @@ module IsoDoc
|
|
6
6
|
module ITU
|
7
7
|
module BaseConvert
|
8
8
|
def norm_ref(isoxml, out, num)
|
9
|
-
q = "//bibliography/references[
|
9
|
+
q = "//bibliography/references[@normative = 'true']"
|
10
10
|
f = isoxml.at(ns(q)) or return num
|
11
11
|
out.div do |div|
|
12
12
|
num = num + 1
|
@@ -18,7 +18,8 @@ module IsoDoc
|
|
18
18
|
|
19
19
|
def nonstd_bibitem(list, b, ordinal, biblio)
|
20
20
|
list.p **attr_code(iso_bibitem_entry_attrs(b, biblio)) do |ref|
|
21
|
-
|
21
|
+
id = render_identifier(bibitem_ref_code(b))
|
22
|
+
ref << (id[0] || "[#{id[1]}]")
|
22
23
|
date_note_process(b, ref)
|
23
24
|
insert_tab(ref, 1)
|
24
25
|
reference_format(b, ref)
|
@@ -29,6 +30,12 @@ module IsoDoc
|
|
29
30
|
nonstd_bibitem(list, b, ordinal, biblio)
|
30
31
|
end
|
31
32
|
|
33
|
+
def bracket_if_num(x)
|
34
|
+
return nil if x.nil?
|
35
|
+
x = x.text.sub(/^\[/, "").sub(/\]$/, "")
|
36
|
+
"[#{x}]"
|
37
|
+
end
|
38
|
+
|
32
39
|
def reference_format(b, r)
|
33
40
|
reference_format_start(b, r)
|
34
41
|
reference_format_title(b, r)
|
@@ -38,29 +45,21 @@ module IsoDoc
|
|
38
45
|
s.gsub(/ |\_|\-/, " ").split(/ /).map(&:capitalize).join(" ")
|
39
46
|
end
|
40
47
|
|
41
|
-
def
|
42
|
-
|
43
|
-
id ||= b.at(ns("./docidentifier[@type = 'ITU']"))
|
44
|
-
id ||= b.at(ns("./docidentifier[not(@type = 'DOI' or @type = 'ISSN' or "\
|
45
|
-
"@type = 'ISBN')]"))
|
46
|
-
id ||= b.at(ns("./docidentifier"))
|
47
|
-
return id if id
|
48
|
-
id = Nokogiri::XML::Node.new("docidentifier", b.document)
|
49
|
-
id.text = "(NO ID)"
|
50
|
-
id
|
48
|
+
def pref_ref_code(b)
|
49
|
+
b.at(ns("./docidentifier[@type = 'ITU']")) || super
|
51
50
|
end
|
52
51
|
|
52
|
+
IGNORE_IDS =
|
53
|
+
"@type = 'DOI' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor'".freeze
|
54
|
+
|
53
55
|
def multi_bibitem_ref_code(b)
|
54
|
-
id = b.xpath(ns("./docidentifier[not(@type = '
|
55
|
-
|
56
|
-
id.empty?
|
57
|
-
"@type = 'ISSN' or @type = 'ISBN')]"))
|
58
|
-
id.empty? and id = b.xpath(ns("./docidentifier"))
|
59
|
-
return ["(NO ID)"] if id.empty?
|
56
|
+
id = b.xpath(ns("./docidentifier[not(@type = 'metanorma' or #{IGNORE_IDS})]"))
|
57
|
+
id.empty? and id = b.xpath(ns("./docidentifier[not(@type = 'metanorma')]"))
|
58
|
+
return [] if id.empty?
|
60
59
|
id.sort_by { |i| i["type"] == "ITU" ? 0 : 1 }
|
61
60
|
end
|
62
61
|
|
63
|
-
def
|
62
|
+
def render_multi_identifiers(ids)
|
64
63
|
ids.map do |id|
|
65
64
|
id["type"] == "ITU" ? doctype_title(id) :
|
66
65
|
docid_prefix(id["type"], id.text.sub(/^\[/, "").sub(/\]$/, ""))
|
@@ -79,10 +78,11 @@ module IsoDoc
|
|
79
78
|
|
80
79
|
def reference_format_start(b, r)
|
81
80
|
id = multi_bibitem_ref_code(b)
|
82
|
-
|
81
|
+
id1 = render_multi_identifiers(id)
|
82
|
+
r << id1
|
83
83
|
date = b.at(ns("./date[@type = 'published']")) and
|
84
84
|
r << " (#{date.text.sub(/-.*$/, '')})"
|
85
|
-
r << ", "
|
85
|
+
r << ", " if (date || !id1.empty?)
|
86
86
|
end
|
87
87
|
|
88
88
|
def reference_format_title(b, r)
|
@@ -96,6 +96,11 @@ module IsoDoc
|
|
96
96
|
/\.$/.match(title&.text) or r << "."
|
97
97
|
end
|
98
98
|
end
|
99
|
+
|
100
|
+
def reference_names(ref)
|
101
|
+
super
|
102
|
+
@anchors[ref["id"]] = { xref: @anchors[ref["id"]][:xref].sub(/^\[/, '').sub(/\]$/, '') }
|
103
|
+
end
|
99
104
|
end
|
100
105
|
end
|
101
106
|
end
|
data/lib/isodoc/itu/terms.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
module IsoDoc
|
2
2
|
module ITU
|
3
3
|
module BaseConvert
|
4
|
-
def
|
5
|
-
|
6
|
-
super
|
4
|
+
def term_def_title(node)
|
5
|
+
node
|
7
6
|
end
|
8
7
|
|
9
8
|
def terms_defs(node, out, num)
|
10
9
|
f = node.at(ns(IsoDoc::Convert::TERM_CLAUSE)) or return num
|
11
10
|
out.div **attr_code(id: f["id"]) do |div|
|
12
11
|
num = num + 1
|
13
|
-
clause_name(num,
|
12
|
+
clause_name(num, term_def_title(f.at(ns("./title"))), div, nil)
|
14
13
|
if f.at(ns("./clause | ./terms | ./term")).nil? then out.p "None."
|
15
14
|
else
|
16
15
|
f.children.reject { |c1| c1.name == "title" }.each do |c1|
|
@@ -48,7 +48,7 @@ module IsoDoc
|
|
48
48
|
kw.nil? || kw.empty? and return
|
49
49
|
out.div do |div|
|
50
50
|
clause_name(nil, "Keywords", div, class: "IntroTitle")
|
51
|
-
div.p kw.
|
51
|
+
div.p kw.join(", ") + "."
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -105,19 +105,22 @@ module IsoDoc
|
|
105
105
|
super
|
106
106
|
abstractbox = docxml.at("//div[@id='abstractbox']")
|
107
107
|
historybox = docxml.at("//div[@id='historybox']")
|
108
|
+
sourcebox = docxml.at("//div[@id='sourcebox']")
|
108
109
|
keywordsbox = docxml.at("//div[@id='keywordsbox']")
|
109
110
|
abstract = docxml.at("//p[@class = 'h1Preface' and text() = 'Summary']/..")
|
110
111
|
history = docxml.at("//p[@class = 'h1Preface' and text() = 'History']/..")
|
112
|
+
source = docxml.at("//p[@class = 'h1Preface' and text() = 'Source']/..")
|
111
113
|
keywords = docxml.at("//p[@class = 'h1Preface' and text() = 'Keywords']/..")
|
112
114
|
abstract.parent = abstractbox if abstract && abstractbox
|
113
115
|
history.parent = historybox if history && historybox
|
116
|
+
source.parent = sourcebox if source && sourcebox
|
114
117
|
keywords.parent = keywordsbox if keywords && keywordsbox
|
115
118
|
end
|
116
119
|
|
117
120
|
def formula_parse1(node, out)
|
118
121
|
out.div **attr_code(id: node["id"], class: "formula") do |div|
|
119
122
|
div.p **attr_code(class: "formula") do |p|
|
120
|
-
insert_tab(div,
|
123
|
+
insert_tab(div, 1)
|
121
124
|
parse(node.at(ns("./stem")), div)
|
122
125
|
lbl = anchor(node['id'], :label, false)
|
123
126
|
unless lbl.nil?
|
data/lib/isodoc/itu/xref.rb
CHANGED
@@ -15,9 +15,13 @@ module IsoDoc
|
|
15
15
|
@anchors[clause["id"]] =
|
16
16
|
{ label: annex_name_lbl(clause, num), type: "clause",
|
17
17
|
xref: "#{lbl} #{num}", level: 1 }
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
if a = single_annex_special_section(clause)
|
19
|
+
annex_names1(a, "#{num}", 1)
|
20
|
+
else
|
21
|
+
clause.xpath(ns("./clause | ./references | ./terms | ./definitions")).
|
22
|
+
each_with_index do |c, i|
|
23
|
+
annex_names1(c, "#{num}.#{i + 1}", 2)
|
24
|
+
end
|
21
25
|
end
|
22
26
|
hierarchical_asset_names(clause, num)
|
23
27
|
end
|
@@ -52,8 +56,8 @@ module IsoDoc
|
|
52
56
|
hierarchical_asset_names(d.xpath("//xmlns:preface/child::*"), "Preface") :
|
53
57
|
sequential_asset_names(d.xpath("//xmlns:preface/child::*"))
|
54
58
|
n = section_names(d.at(ns("//clause[title = 'Scope']")), 0, 1)
|
55
|
-
n = section_names(d.at(ns("//bibliography/clause[
|
56
|
-
"//bibliography/references[
|
59
|
+
n = section_names(d.at(ns("//bibliography/clause[.//references[@normative = 'true']] | "\
|
60
|
+
"//bibliography/references[@normative = 'true']")), n, 1)
|
57
61
|
n = section_names(d.at(ns("//sections/terms | "\
|
58
62
|
"//sections/clause[descendant::terms]")), n, 1)
|
59
63
|
n = section_names(d.at(ns("//sections/definitions")), n, 1)
|
@@ -68,10 +72,10 @@ module IsoDoc
|
|
68
72
|
end
|
69
73
|
|
70
74
|
MIDDLE_SECTIONS = "//clause[title = 'Scope'] | "\
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
+
"//foreword | //introduction | //acknowledgements | "\
|
76
|
+
"//references[@normative = 'true'] | "\
|
77
|
+
"//sections/terms | //preface/clause | "\
|
78
|
+
"//sections/definitions | //clause[parent::sections]".freeze
|
75
79
|
|
76
80
|
def middle_section_asset_names(d)
|
77
81
|
return super unless @hierarchical_assets
|
@@ -89,7 +93,7 @@ module IsoDoc
|
|
89
93
|
j = 0
|
90
94
|
c.increment(t)
|
91
95
|
end
|
92
|
-
label = c.print + (j.zero? ? "" : "-#{(
|
96
|
+
label = c.print + (j.zero? ? "" : "-#{(96 + j).chr.to_s}")
|
93
97
|
next if t["id"].nil? || t["id"].empty?
|
94
98
|
@anchors[t["id"]] =
|
95
99
|
anchor_struct(label, nil, @figure_lbl, "figure", t["unnumbered"])
|
@@ -106,7 +110,7 @@ module IsoDoc
|
|
106
110
|
c.increment(t)
|
107
111
|
end
|
108
112
|
label = "#{num}#{hiersep}#{c.print}" +
|
109
|
-
(j.zero? ? "" : "#{hierfigsep}#{(
|
113
|
+
(j.zero? ? "" : "#{hierfigsep}#{(96 + j).chr.to_s}")
|
110
114
|
next if t["id"].nil? || t["id"].empty?
|
111
115
|
@anchors[t["id"]] = anchor_struct(label, nil, @figure_lbl, "figure",
|
112
116
|
t["unnumbered"])
|
@@ -116,7 +120,7 @@ module IsoDoc
|
|
116
120
|
def sequential_formula_names(clause)
|
117
121
|
clause&.first&.xpath(ns(MIDDLE_SECTIONS))&.each do |c|
|
118
122
|
if c["id"] && @anchors[c["id"]]
|
119
|
-
|
123
|
+
hierarchical_formula_names(c, @anchors[c["id"]][:label] || @anchors[c["id"]][:xref] || "???")
|
120
124
|
else
|
121
125
|
hierarchical_formula_names(c, "???")
|
122
126
|
end
|
@@ -2,6 +2,14 @@ require "metanorma/processor"
|
|
2
2
|
|
3
3
|
module Metanorma
|
4
4
|
module ITU
|
5
|
+
def self.fonts_used
|
6
|
+
{
|
7
|
+
html: ["Arial", "Courier New", "Times New Roman"],
|
8
|
+
doc: ["Arial", "Courier New", "Times New Roman"],
|
9
|
+
pdf: ["Arial", "Courier New", "Times New Roman"]
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
5
13
|
class Processor < Metanorma::Processor
|
6
14
|
|
7
15
|
def initialize
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-itu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -269,12 +269,14 @@ files:
|
|
269
269
|
- lib/isodoc/itu/html/itu.scss
|
270
270
|
- lib/isodoc/itu/html/logo.png
|
271
271
|
- lib/isodoc/itu/html/scripts.html
|
272
|
-
- lib/isodoc/itu/html/scripts.pdf.html
|
273
272
|
- lib/isodoc/itu/html/word_itu_intro.html
|
274
273
|
- lib/isodoc/itu/html/word_itu_titlepage.html
|
275
274
|
- lib/isodoc/itu/html/wordstyle.scss
|
276
275
|
- lib/isodoc/itu/html_convert.rb
|
277
276
|
- lib/isodoc/itu/i18n-en.yaml
|
277
|
+
- lib/isodoc/itu/itu.recommendation-annex.xsl
|
278
|
+
- lib/isodoc/itu/itu.recommendation.xsl
|
279
|
+
- lib/isodoc/itu/itu.resolution.xsl
|
278
280
|
- lib/isodoc/itu/metadata.rb
|
279
281
|
- lib/isodoc/itu/pdf_convert.rb
|
280
282
|
- lib/isodoc/itu/ref.rb
|
@@ -1,72 +0,0 @@
|
|
1
|
-
<script>
|
2
|
-
//TOC generation
|
3
|
-
$('#toc').toc({
|
4
|
-
'selectors': toclevel(), //elements to use as headings
|
5
|
-
'container': 'main', //element to find all selectors in
|
6
|
-
'smoothScrolling': true, //enable or disable smooth scrolling on click
|
7
|
-
'prefix': 'toc', //prefix for anchor tags and class names
|
8
|
-
'onHighlight': function(el) {}, //called when a new section is highlighted
|
9
|
-
'highlightOnScroll': false, //add class to heading that is currently in focus
|
10
|
-
'highlightOffset': 100, //offset to trigger the next headline
|
11
|
-
'anchorName': function(i, heading, prefix) { //custom function for anchor name
|
12
|
-
return prefix+i;
|
13
|
-
},
|
14
|
-
'headerText': function(i, heading, $heading) { //custom function building the header-item text
|
15
|
-
return $heading.text();
|
16
|
-
},
|
17
|
-
'itemClass': function(i, heading, $heading, prefix) { // custom function for item class
|
18
|
-
return $heading[0].tagName.toLowerCase();
|
19
|
-
}
|
20
|
-
});
|
21
|
-
|
22
|
-
</script>
|
23
|
-
|
24
|
-
<script>
|
25
|
-
//TOC toggle animation
|
26
|
-
$('#toggle').on('click', function(){
|
27
|
-
if( $('nav').is(':visible') ) {
|
28
|
-
$('nav').animate({ 'left': '-353px' }, 'slow', function(){
|
29
|
-
$('nav').hide();
|
30
|
-
});
|
31
|
-
$('.container').animate({ 'padding-left': '31px' }, 'slow');
|
32
|
-
}
|
33
|
-
else {
|
34
|
-
$('nav').show();
|
35
|
-
$('nav').animate({ 'left': '0px' }, 'slow');
|
36
|
-
$('.container').animate({ 'padding-left': '360px' }, 'slow');
|
37
|
-
}
|
38
|
-
});
|
39
|
-
</script>
|
40
|
-
|
41
|
-
<script>
|
42
|
-
// Scroll to top button
|
43
|
-
window.onscroll = function() {scrollFunction()};
|
44
|
-
|
45
|
-
function scrollFunction() {
|
46
|
-
if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
|
47
|
-
document.getElementById("myBtn").style.display = "block";
|
48
|
-
} else {
|
49
|
-
document.getElementById("myBtn").style.display = "none";
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
// When the user clicks on the button, scroll to the top of the document
|
54
|
-
function topFunction() {
|
55
|
-
document.body.scrollTop = 0;
|
56
|
-
document.documentElement.scrollTop = 0;
|
57
|
-
}
|
58
|
-
</script>
|
59
|
-
|
60
|
-
<script>
|
61
|
-
/*
|
62
|
-
$(document).ready(function() {
|
63
|
-
$('[id^=toc]').each(function ()
|
64
|
-
{
|
65
|
-
var currentToc = $(this);
|
66
|
-
var url = window.location.href;
|
67
|
-
currentToc.wrap("<a href='" + url + "#" + currentToc.attr("id") + "' </a>");
|
68
|
-
});
|
69
|
-
});
|
70
|
-
*/
|
71
|
-
</script>
|
72
|
-
|