isodoc 1.5.5 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +2 -12
  3. data/.hound.yml +3 -1
  4. data/.rubocop.yml +3 -7
  5. data/Gemfile +2 -2
  6. data/Rakefile +2 -2
  7. data/bin/rspec +1 -2
  8. data/isodoc.gemspec +11 -11
  9. data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
  10. data/lib/isodoc-yaml/i18n-de.yaml +149 -0
  11. data/lib/isodoc-yaml/i18n-es.yaml +151 -0
  12. data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
  13. data/lib/isodoc.rb +0 -2
  14. data/lib/isodoc/base_style/all.css +7 -0
  15. data/lib/isodoc/base_style/metanorma_word.css +7 -0
  16. data/lib/isodoc/base_style/metanorma_word.scss +8 -0
  17. data/lib/isodoc/base_style/reset.css +7 -0
  18. data/lib/isodoc/base_style/reset.scss +9 -0
  19. data/lib/isodoc/base_style/scripts.html +187 -0
  20. data/lib/isodoc/class_utils.rb +6 -5
  21. data/lib/isodoc/common.rb +2 -0
  22. data/lib/isodoc/convert.rb +30 -17
  23. data/lib/isodoc/css.rb +43 -34
  24. data/lib/isodoc/function/blocks.rb +21 -4
  25. data/lib/isodoc/function/blocks_example_note.rb +2 -2
  26. data/lib/isodoc/function/cleanup.rb +53 -45
  27. data/lib/isodoc/function/form.rb +51 -0
  28. data/lib/isodoc/function/inline.rb +37 -15
  29. data/lib/isodoc/function/references.rb +55 -42
  30. data/lib/isodoc/function/section.rb +29 -16
  31. data/lib/isodoc/function/table.rb +1 -0
  32. data/lib/isodoc/function/to_word_html.rb +33 -29
  33. data/lib/isodoc/function/utils.rb +180 -159
  34. data/lib/isodoc/gem_tasks.rb +30 -31
  35. data/lib/isodoc/headlesshtml_convert.rb +8 -7
  36. data/lib/isodoc/html_convert.rb +6 -4
  37. data/lib/isodoc/html_function/comments.rb +2 -0
  38. data/lib/isodoc/html_function/footnotes.rb +14 -7
  39. data/lib/isodoc/html_function/form.rb +62 -0
  40. data/lib/isodoc/html_function/html.rb +30 -26
  41. data/lib/isodoc/html_function/postprocess.rb +41 -82
  42. data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
  43. data/lib/isodoc/i18n.rb +33 -31
  44. data/lib/isodoc/pdf_convert.rb +12 -16
  45. data/lib/isodoc/presentation_function/bibdata.rb +54 -30
  46. data/lib/isodoc/presentation_function/block.rb +17 -8
  47. data/lib/isodoc/presentation_function/inline.rb +84 -120
  48. data/lib/isodoc/presentation_function/math.rb +84 -0
  49. data/lib/isodoc/presentation_function/section.rb +20 -22
  50. data/lib/isodoc/presentation_xml_convert.rb +2 -1
  51. data/lib/isodoc/sassc_importer.rb +1 -1
  52. data/lib/isodoc/version.rb +1 -1
  53. data/lib/isodoc/word_function/body.rb +28 -24
  54. data/lib/isodoc/word_function/footnotes.rb +22 -15
  55. data/lib/isodoc/word_function/postprocess.rb +50 -36
  56. data/lib/isodoc/xref.rb +9 -10
  57. data/lib/isodoc/xref/xref_counter.rb +32 -17
  58. data/lib/isodoc/xref/xref_gen.rb +33 -21
  59. data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
  60. data/lib/isodoc/xref/xref_sect_gen.rb +37 -35
  61. data/lib/isodoc/xslfo_convert.rb +36 -27
  62. data/spec/assets/scripts_override.html +3 -0
  63. data/spec/isodoc/blocks_spec.rb +2490 -2591
  64. data/spec/isodoc/cleanup_spec.rb +1107 -1109
  65. data/spec/isodoc/footnotes_spec.rb +1 -16
  66. data/spec/isodoc/form_spec.rb +156 -0
  67. data/spec/isodoc/i18n_spec.rb +984 -972
  68. data/spec/isodoc/inline_spec.rb +1129 -912
  69. data/spec/isodoc/lists_spec.rb +316 -315
  70. data/spec/isodoc/postproc_spec.rb +1751 -1540
  71. data/spec/isodoc/presentation_xml_spec.rb +403 -323
  72. data/spec/isodoc/ref_spec.rb +718 -723
  73. data/spec/isodoc/section_spec.rb +910 -902
  74. data/spec/isodoc/table_spec.rb +566 -556
  75. data/spec/isodoc/terms_spec.rb +251 -255
  76. data/spec/isodoc/xref_spec.rb +3041 -2992
  77. data/spec/isodoc/xslfo_convert_spec.rb +39 -0
  78. data/spec/spec_helper.rb +30 -29
  79. metadata +77 -65
@@ -0,0 +1,151 @@
1
+ term_def_boilerplate:
2
+ scope: Alcance
3
+ symbolsabbrev: Símbolos y términos abreviados
4
+ abbrev: Términos abreviados
5
+ symbols: Símbolos
6
+ table_of_contents: Índice
7
+ introduction: Introducción
8
+ foreword: Prólogo
9
+ abstract: Resumen
10
+ acknowledgements: Agradecimientos
11
+ termsdef: Términos y definiciones
12
+ termsdefsymbolsabbrev: Términos, definiciones, símbolos y términos abreviados
13
+ termsdefsymbols: Términos, definiciones y símbolos
14
+ termsdefabbrev: Términos, definiciones y términos abreviados
15
+ normref: Referencias normativas
16
+ bibliography: Bibliografía
17
+ clause: Cláusula
18
+ annex: Anexo
19
+ appendix: Apéndice
20
+ no_terms_boilerplate: |
21
+ <p>En este documento no se enumeran términos ni definiciones.</p>
22
+ internal_terms_boilerplate: |
23
+ <p>Para los propósitos de este documento, se aplican los siguientes términos y definiciones.</p>
24
+ norm_with_refs_pref:
25
+ Los siguientes documentos se mencionan en el texto de tal manera que
26
+ parte o todo su contenido constituye requisitos de este documento.
27
+ Para referencias con fecha, sólo se aplica la edición citada. Para
28
+ referencias sin fecha, se aplica la última edición del documento
29
+ referenciado (incluidas las enmiendas).
30
+ norm_empty_pref:
31
+ No hay referencias normativas en este documento.
32
+ external_terms_boilerplate: |
33
+ <p>Para los propósitos de este documento, se aplican los términos y definiciones dados en %.</p>
34
+ internal_external_terms_boilerplate: |
35
+ <p>Para los propósitos de este documento, se aplican los términos y definiciones dados en % y los siguientes.</p>
36
+ term_defined_in: "[término definido en %]"
37
+ note: NOTA
38
+ note_xref: Nota
39
+ termnote: Nota % a la entrada
40
+ list: Lista
41
+ figure: Figura
42
+ formula: Fórmula
43
+ inequality: Fórmula
44
+ table: Tabla
45
+ requirement: Requerimiento
46
+ recommendation: Recomendación
47
+ permission: Permiso
48
+ key: Clave
49
+ example: EJEMPLO
50
+ example_xref: Ejemplo
51
+ where: donde
52
+ wholeoftext: Todo el texto
53
+ draft_label: borrador
54
+ inform_annex: informativo
55
+ norm_annex: normativo
56
+ modified: modificado
57
+ deprecated: OBSOLETO
58
+ source: FUENTE
59
+ and: y
60
+ all_parts: Todas las partes
61
+ month_january: Enero
62
+ month_february: Febrero
63
+ month_march: Marzo
64
+ month_april: Abril
65
+ month_may: Mayo
66
+ month_june: Junio
67
+ month_july: Julio
68
+ month_august: Agosto
69
+ month_september: Septiembre
70
+ month_october: Octubre
71
+ month_november: Noviembre
72
+ month_december: Diciembre
73
+ obligation: Obligación
74
+ subject: Tema
75
+ inherits: Hereda
76
+ admonition: {
77
+ danger: Peligro,
78
+ warning: Advertencia,
79
+ caution: Precaución,
80
+ important: Importante,
81
+ safety precautions: Precauciones de seguridad
82
+ }
83
+ locality: {
84
+ section: Sección,
85
+ clause: Cláusula,
86
+ part: Parte,
87
+ paragraph: Párrafo,
88
+ chapter: Capítulo,
89
+ page: Página,
90
+ table: Tabla,
91
+ annex: Anexo,
92
+ figure: Figura,
93
+ example: Ejemplo,
94
+ note: Nota,
95
+ formula: Fórmula
96
+ }
97
+ inflection:
98
+ Cláusula:
99
+ sg: Cláusula
100
+ pl: Cláusulas
101
+ Anexo:
102
+ sg: Anexo
103
+ pl: Anexos
104
+ Apéndice:
105
+ sg: Apéndice
106
+ pl: Apéndices
107
+ Nota:
108
+ sg: Nota
109
+ pl: Notas
110
+ "Nota % a la entrada":
111
+ sg: Nota % a la entrada
112
+ pl: Notas % a la entrada
113
+ Lista:
114
+ sg: Lista
115
+ pl: Listas
116
+ Figura:
117
+ sg: Figura
118
+ pl: Figuras
119
+ Fórmula:
120
+ sg: Fórmula
121
+ pl: Fórmulas
122
+ Tabla:
123
+ sg: Tabla
124
+ pl: Tablas
125
+ Requerimiento:
126
+ sg: Requerimiento
127
+ pl: Requerimientos
128
+ Recomendación:
129
+ sg: Recomendación
130
+ pl: Recomendaciones
131
+ Permiso:
132
+ sg: Permiso
133
+ pl: Permisos
134
+ Ejemplo:
135
+ sg: Ejemplo
136
+ pl: Ejemplos
137
+ Parte:
138
+ sg: Parte
139
+ pl: Partes
140
+ Sección:
141
+ sg: Sección
142
+ pl: Secciones
143
+ Párrafo:
144
+ sg: Párrafo
145
+ pl: Párrafos
146
+ Capítulo:
147
+ sg: Capítulo
148
+ pl: Capítulos
149
+ Página:
150
+ sg: Página
151
+ pl: Páginas
@@ -0,0 +1,154 @@
1
+ term_def_boilerplate:
2
+ scope: Сфера применения
3
+ symbolsabbrev: Символы и сокращенные термины
4
+ abbrev: Сокращенные термины
5
+ symbols: Символы
6
+ table_of_contents: Содержание
7
+ introduction: Введение
8
+ foreword: Предисловие
9
+ abstract: Реферат
10
+ acknowledgements: Подтверждения
11
+ termsdef: Термины и определения
12
+ termsdefsymbolsabbrev: Термины, определения, символы и сокращенные термины
13
+ termsdefsymbols: Термины, определения и символы
14
+ termsdefabbrev: Термины, определения и сокращенные термины
15
+ normref: Нормативные ссылки
16
+ bibliography: Библиография
17
+ clause: Пункт
18
+ annex: Дополнение
19
+ appendix: Приложение
20
+ no_terms_boilerplate: |
21
+ <p>Термины и определения не перечислены в этом документе.</p>
22
+ internal_terms_boilerplate: |
23
+ <p>Для целей этого документа
24
+ применяются следующие термины и определения.</p>
25
+ norm_with_refs_pref:
26
+ Следующие документы упоминаются в тексте таким образом,
27
+ что некоторая часть или все их содержание являются требованиями
28
+ настоящего документа. Для датированных ссылок применяют только указанное издание.
29
+ Для недатированных ссылок применяют последнее издание
30
+ указанного документа (включая любые поправки).
31
+ norm_empty_pref:
32
+ Нет нормативных ссылок в этом документе.
33
+ external_terms_boilerplate: |
34
+ <p>Для целей этого документа применяются
35
+ термины и определения, данные в %.</p>
36
+ internal_external_terms_boilerplate: |
37
+ <p>Для целей этого документа применяются
38
+ термины и определения, данные в % и следующие.</p>
39
+ term_defined_in: "[термин, определенный в %]"
40
+ note: ПРИМЕЧАНИЕ
41
+ note_xref: Примечание
42
+ termnote: Примечание % к определению
43
+ list: Список
44
+ figure: Рисунок
45
+ formula: Формула
46
+ inequality: Формула
47
+ table: Таблица
48
+ requirement: Требование
49
+ recommendation: Рекомендация
50
+ permission: Разрешение
51
+ key: Условные обозначения
52
+ example: ПРИМЕР
53
+ example_xref: Пример
54
+ where: где
55
+ wholeoftext: Текст полностью
56
+ draft_label: проект
57
+ inform_annex: информативное
58
+ norm_annex: нормативное
59
+ modified: изменен
60
+ deprecated: НЕ РЕКОМЕНДУЕТСЯ
61
+ source: ИСТОЧНИК
62
+ and: и
63
+ all_parts: Все части
64
+ month_january: Январь
65
+ month_february: Февраль
66
+ month_march: Март
67
+ month_april: Апрель
68
+ month_may: Май
69
+ month_june: Июнь
70
+ month_july: Июль
71
+ month_august: Август
72
+ month_september: Сентябрь
73
+ month_october: Октябрь
74
+ month_november: Ноябрь
75
+ month_december: Декабрь
76
+ obligation: Обязательство
77
+ subject: Тема
78
+ inherits: Наследует
79
+ admonition: {
80
+ danger: Опасность,
81
+ warning: Предупреждение,
82
+ caution: Предостережение,
83
+ important: Важно,
84
+ safety precautions: Меры безопасности
85
+ }
86
+ locality: {
87
+ section: Раздел,
88
+ clause: Пункт,
89
+ part: Часть,
90
+ paragraph: Абзац,
91
+ chapter: Глава,
92
+ page: Стр.,
93
+ table: Таблица,
94
+ annex: Дополнение,
95
+ figure: Рисунок,
96
+ example: Пример,
97
+ note: Примечание,
98
+ formula: Формула
99
+ }
100
+ inflection:
101
+ Пункт:
102
+ sg: Пункт
103
+ pl: Пункты
104
+ Дополнение:
105
+ sg: Дополнение
106
+ pl: Дополнения
107
+ Приложение:
108
+ sg: Приложение
109
+ pl: Приложения
110
+ Примечание:
111
+ sg: Примечание
112
+ pl: Примечания
113
+ "Примечание % к записи":
114
+ sg: Примечание % к записи
115
+ pl: Примечания % к записи
116
+ Список:
117
+ sg: Список
118
+ pl: Списки
119
+ Рисунок:
120
+ sg: Рисунок
121
+ pl: Рисунки
122
+ Формула:
123
+ sg: Формула
124
+ pl: Формулы
125
+ Таблица:
126
+ sg: Таблица
127
+ pl: Таблицы
128
+ Требование:
129
+ sg: Требование
130
+ pl: Требования
131
+ Рекомендация:
132
+ sg: Рекомендация
133
+ pl: Рекомендации
134
+ Разрешение:
135
+ sg: Разрешение
136
+ pl: Разрешения
137
+ Пример:
138
+ sg: Пример
139
+ pl: Примеры
140
+ Часть:
141
+ sg: Часть
142
+ pl: Части
143
+ Раздел:
144
+ sg: Раздел
145
+ pl: Разделы
146
+ Абзац:
147
+ sg: Абзац
148
+ pl: Абзацы
149
+ Глава:
150
+ sg: Глава
151
+ pl: Главы
152
+ "Стр.":
153
+ sg: Стр.
154
+ pl: Стр.
data/lib/isodoc.rb CHANGED
@@ -8,7 +8,6 @@ require "mime/types"
8
8
  require "image_size"
9
9
  require "set"
10
10
  require "pp"
11
- require "uuidtools"
12
11
  require "html2doc"
13
12
  require "liquid"
14
13
  require "htmlentities"
@@ -26,5 +25,4 @@ require "isodoc/xref"
26
25
  require "isodoc/i18n"
27
26
 
28
27
  module IsoDoc
29
-
30
28
  end
@@ -108,6 +108,13 @@ a.FootnoteRef + a.FootnoteRef:before {
108
108
  content: ", ";
109
109
  vertical-align: super; }
110
110
 
111
+ .addition {
112
+ color: blue; }
113
+
114
+ .deletion {
115
+ color: red;
116
+ text-decoration: line-through; }
117
+
111
118
  #standard-band {
112
119
  background-color: #0AC442; }
113
120
 
@@ -38,3 +38,10 @@ br.section {
38
38
  br.pagebreak {
39
39
  page-break-before: always;
40
40
  mso-special-character: line-break; }
41
+
42
+ span.addition {
43
+ color: blue; }
44
+
45
+ span.deletion {
46
+ color: red;
47
+ text-decoration: line-through; }
@@ -34,3 +34,11 @@ br.section
34
34
  br.pagebreak
35
35
  {page-break-before:always;
36
36
  mso-special-character:line-break;}
37
+
38
+ span.addition {
39
+ color: blue;
40
+ }
41
+ span.deletion {
42
+ color: red;
43
+ text-decoration: line-through;
44
+ }
@@ -107,3 +107,10 @@ div.document-stage-band, div.document-type-band {
107
107
  a.FootnoteRef + a.FootnoteRef:before {
108
108
  content: ", ";
109
109
  vertical-align: super; }
110
+
111
+ .addition {
112
+ color: blue; }
113
+
114
+ .deletion {
115
+ color: red;
116
+ text-decoration: line-through; }
@@ -132,3 +132,12 @@ a.FootnoteRef + a.FootnoteRef:before {
132
132
  content: ", ";
133
133
  vertical-align: super;
134
134
  }
135
+
136
+ .addition {
137
+ color: blue;
138
+ }
139
+
140
+ .deletion {
141
+ color: red;
142
+ text-decoration: line-through;
143
+ }
@@ -0,0 +1,187 @@
1
+ <script>
2
+ $("#toc").on('click', 'li', function(e) {
3
+ $(this).parent().find('li.toc-active').removeClass('toc-active');
4
+ $(this).addClass('toc-active');
5
+ });
6
+ </script>
7
+
8
+ <script>
9
+ //TOC toggle animation
10
+ $('#toggle').on('click', function(){
11
+ if( $('nav').is(':visible') ) {
12
+ $('nav').animate({ 'left': '-353px' }, 'slow', function(){
13
+ $('nav').hide();
14
+ });
15
+ $('body').animate({ 'margin-left': '0' }, 'slow');
16
+ }
17
+ else {
18
+ $('nav').show();
19
+ $('nav').animate({ 'left': '0px' }, 'slow');
20
+ $('body').animate({ 'margin-left': '298px' }, 'slow');
21
+ }
22
+ });
23
+ </script>
24
+
25
+ <script>
26
+ // Scroll to top button
27
+ window.onscroll = function() {scrollFunction()};
28
+
29
+ function scrollFunction() {
30
+ if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
31
+ document.getElementById("myBtn").style.display = "block";
32
+ } else {
33
+ document.getElementById("myBtn").style.display = "none";
34
+ }
35
+ }
36
+
37
+ // When the user clicks on the button, scroll to the top of the document
38
+ function topFunction() {
39
+ document.body.scrollTop = 0;
40
+ document.documentElement.scrollTop = 0;
41
+ }
42
+ </script>
43
+
44
+ <script>
45
+ /*
46
+ $(document).ready(function() {
47
+ $('[id^=toc]').each(function ()
48
+ {
49
+ var currentToc = $(this);
50
+ var url = window.location.href;
51
+ currentToc.wrap("<a href='" + url + "#" + currentToc.attr("id") + "'></a>");
52
+ });
53
+ });
54
+ */
55
+ </script>
56
+
57
+ <script>
58
+ document.querySelectorAll('*|svg a').forEach(function(item) {
59
+ var loc = item.getAttribute('href');
60
+ if (loc !== null && loc.startsWith('#')) {
61
+ item.setAttribute('href', location.pathname + loc);
62
+ }
63
+ });
64
+ </script>
65
+
66
+
67
+ <script>
68
+
69
+ // jQuery Inline Footnotes v1.0.3
70
+ // Copyright (c) 2011 Vesa Vänskä, released under the MIT License.
71
+
72
+ // Generated by CoffeeScript 1.6.1
73
+ (function() {
74
+
75
+ (function($) {
76
+ $.inlineFootnote = function(el, options) {
77
+ var _this = this;
78
+ this.el = $(el);
79
+ this.el.data("inlineFootnote", this);
80
+ this.initialize = function() {
81
+ this.options = $.extend({}, $.inlineFootnote.defaultOptions, options);
82
+ this.footnoteId = this.el.attr("href").match(/#(.*)/)[1];
83
+ if (this.footnoteId) {
84
+ this.el.mouseenter(this.openBox);
85
+ return $("body").mousemove(this.closeBox);
86
+ }
87
+ };
88
+ this.openBox = function(event) {
89
+ var footnoteContent, linkOffset;
90
+ if (!_this.box) {
91
+ footnoteContent = $("[id='" + _this.footnoteId + "']").children().filter(":not('" + _this.options.hideFromContent + "')");
92
+ linkOffset = _this.el.offset();
93
+ _this.box = $("<div />", {
94
+ id: _this.options.boxId,
95
+ html: footnoteContent.clone().find(_this.options.hideFromContent).remove().end(),
96
+ css: {
97
+ position: "absolute",
98
+ top: linkOffset.top,
99
+ left: linkOffset.left + _this.el.outerWidth()
100
+ }
101
+ }).appendTo("body");
102
+ return _this.positionBox();
103
+ }
104
+ };
105
+ this.closeBox = function(event) {
106
+ if (_this.box) {
107
+ if (_this.isHoveringFootnote(event)) {
108
+ clearTimeout(_this.closeTimeout);
109
+ return _this.closeTimeout = null;
110
+ } else {
111
+ if (!_this.closeTimeout) {
112
+ return _this.closeTimeout = setTimeout((function() {
113
+ _this.box.remove();
114
+ return _this.box = null;
115
+ }), _this.options.hideDelay);
116
+ }
117
+ }
118
+ }
119
+ };
120
+ this.isHoveringFootnote = function(event) {
121
+ return this.box.is(event.target) || $(event.target).closest(this.box).length > 0 || event.target === this.el[0];
122
+ };
123
+ this.positionBox = function() {
124
+ var boxHorizontalPadding, boxLeft, boxWidth, linkLeftOffset, windowWidth;
125
+ boxHorizontalPadding = parseInt(this.box.css("padding-left")) + parseInt(this.box.css("padding-right"));
126
+ linkLeftOffset = this.el.offset().left;
127
+ windowWidth = $(window).width();
128
+ if ((windowWidth / 2) > linkLeftOffset) {
129
+ boxLeft = linkLeftOffset + 20;
130
+ boxWidth = windowWidth - boxLeft - boxHorizontalPadding - this.options.boxMargin * 2;
131
+ if (boxWidth > this.options.maximumBoxWidth) {
132
+ boxWidth = this.options.maximumBoxWidth;
133
+ }
134
+ } else {
135
+ boxWidth = linkLeftOffset - boxHorizontalPadding - this.options.boxMargin * 2;
136
+ if (boxWidth > this.options.maximumBoxWidth) {
137
+ boxWidth = this.options.maximumBoxWidth;
138
+ }
139
+ boxLeft = linkLeftOffset - boxWidth - this.options.boxMargin * 2;
140
+ }
141
+ return this.box.css({
142
+ width: boxWidth,
143
+ left: boxLeft
144
+ });
145
+ };
146
+ return this.initialize();
147
+ };
148
+ $.inlineFootnote.defaultOptions = {
149
+ boxMargin: 20,
150
+ hideDelay: 200,
151
+ hideFromContent: "[rel=footnote]",
152
+ maximumBoxWidth: 500,
153
+ boxId: "footnote_box"
154
+ };
155
+ return $.fn.inlineFootnote = function(options) {
156
+ return this.each(function() {
157
+ return new $.inlineFootnote(this, options);
158
+ });
159
+ };
160
+ })(jQuery);
161
+
162
+ }).call(this);
163
+ </script>
164
+
165
+ <script>
166
+ $(function() {
167
+ $("[rel=footnote]").inlineFootnote();
168
+ });
169
+ </script>
170
+ <script>
171
+ // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
172
+ //
173
+ // AnchorJS - v4.2.2 - 2020-04-20
174
+ // https://www.bryanbraun.com/anchorjs/
175
+ // Copyright (c) 2020 Bryan Braun; Licensed MIT
176
+ //
177
+ // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
178
+ !function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function f(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.ariaLabel=A.hasOwnProperty("ariaLabel")?A.ariaLabel:"Anchor",A.class=A.hasOwnProperty("class")?A.class:"",A.base=A.hasOwnProperty("base")?A.base:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64,A.titleText=A.hasOwnProperty("titleText")?A.titleText:""}function p(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],f(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,i,n,o,s,a,r,c,h,l,u,d=[];if(f(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),0===(e=p(A=A||"h2, h3, h4, h5, h6")).length)return this;for(!function(){if(null!==document.head.querySelector("style.anchorjs"))return;var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(e):document.head.insertBefore(e,A);e.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",e.sheet.cssRules.length),e.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",e.sheet.cssRules.length),e.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",e.sheet.cssRules.length),e.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',e.sheet.cssRules.length)}(),t=document.querySelectorAll("[id]"),i=[].map.call(t,function(A){return A.id}),o=0;o<e.length;o++)if(this.hasAnchorJSLink(e[o]))d.push(o);else{if(e[o].hasAttribute("id"))n=e[o].getAttribute("id");else if(e[o].hasAttribute("data-anchor-id"))n=e[o].getAttribute("data-anchor-id");else{for(c=r=this.urlify(e[o].textContent),a=0;void 0!==s&&(c=r+"-"+a),a+=1,-1!==(s=i.indexOf(c)););s=void 0,i.push(c),e[o].setAttribute("id",c),n=c}(h=document.createElement("a")).className="anchorjs-link "+this.options.class,h.setAttribute("aria-label",this.options.ariaLabel),h.setAttribute("data-anchorjs-icon",this.options.icon),this.options.titleText&&(h.title=this.options.titleText),u=document.querySelector("base")?window.location.pathname+window.location.search:"",u=this.options.base||u,h.href=u+"#"+n,"always"===l&&(h.style.opacity="1"),""===this.options.icon&&(h.style.font="1em/1 anchorjs-icons","left"===this.options.placement&&(h.style.lineHeight="inherit")),"left"===this.options.placement?(h.style.position="absolute",h.style.marginLeft="-1em",h.style.paddingRight="0.5em",e[o].insertBefore(h,e[o].firstChild)):(h.style.paddingLeft="0.375em",e[o].appendChild(h))}for(o=0;o<d.length;o++)e.splice(d[o]-o,1);return this.elements=this.elements.concat(e),this},this.remove=function(A){for(var e,t,i=p(A),n=0;n<i.length;n++)(t=i[n].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(i[n]))&&this.elements.splice(e,1),i[n].removeChild(t));return this},this.removeAll=function(){this.remove(this.elements)},this.urlify=function(A){return this.options.truncate||f(this.options),A.trim().replace(/\'/gi,"").replace(/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\\n\t\b\v]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),t=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||t||!1}}});
179
+ // @license-end
180
+ </script>
181
+ <script>
182
+ anchors.options = {
183
+ placement: 'left'
184
+ };
185
+ anchors.add('h1, h2, h3, h4');
186
+ </script>
187
+