metanorma-document 0.2.12 → 0.2.13

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 (391) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +21 -0
  3. data/.github/workflows/release.yml +25 -0
  4. data/.github/workflows/roundtrip-samples.yml +132 -0
  5. data/.gitignore +19 -0
  6. data/.rspec +3 -0
  7. data/.rubocop.yml +22 -0
  8. data/.rubocop_todo.yml +66 -164
  9. data/CHANGELOG.md +1 -0
  10. data/Gemfile +32 -0
  11. data/README.adoc +0 -144
  12. data/Rakefile +2 -14
  13. data/bin/console +15 -0
  14. data/bin/setup +8 -0
  15. data/data/javascripts/components/mn-lightbox.js +2 -18
  16. data/data/javascripts/components/mn-shortcuts.js +0 -2
  17. data/data/javascripts/core/mn-navigation.js +0 -8
  18. data/data/javascripts/core/mn-theme.js +9 -9
  19. data/data/logos/pdfa-logo.svg +94 -31
  20. data/data/stylesheets/base/_layout.css +0 -3
  21. data/data/stylesheets/base/_reset.css +3 -3
  22. data/data/stylesheets/base/_typography.css +5 -0
  23. data/data/stylesheets/components/bibliography.css +3 -3
  24. data/data/stylesheets/components/cover.css +1 -3
  25. data/data/stylesheets/components/figure.css +1 -13
  26. data/data/stylesheets/components/footnote.css +5 -65
  27. data/data/stylesheets/components/formula.css +0 -44
  28. data/data/stylesheets/components/header.css +2 -17
  29. data/data/stylesheets/components/inline.css +1 -1
  30. data/data/stylesheets/components/table.css +2 -15
  31. data/data/stylesheets/components/term.css +1 -0
  32. data/lib/metanorma/bipm_document/metadata/bipm_bibliographic_item.rb +14 -0
  33. data/lib/metanorma/bipm_document/metadata.rb +1 -1
  34. data/lib/metanorma/document/components/ancillary_blocks/sourcecode_block.rb +65 -0
  35. data/lib/metanorma/document/components/ancillary_blocks.rb +0 -4
  36. data/lib/metanorma/document/components/bib_data/bib_data.rb +0 -7
  37. data/lib/metanorma/document/components/blocks/requirement_model.rb +131 -0
  38. data/lib/metanorma/document/components/blocks.rb +7 -8
  39. data/lib/metanorma/document/components/id_elements/image.rb +0 -2
  40. data/lib/metanorma/document/components/inline/asciimath_element.rb +0 -2
  41. data/lib/metanorma/document/components/inline/attribution_element.rb +0 -2
  42. data/lib/metanorma/document/components/inline/bcp14_element.rb +0 -2
  43. data/lib/metanorma/document/components/inline/biblio_tag_element.rb +0 -2
  44. data/lib/metanorma/document/components/inline/br_element.rb +0 -2
  45. data/lib/metanorma/document/components/inline/comma_element.rb +0 -2
  46. data/lib/metanorma/document/components/inline/concept_element.rb +0 -2
  47. data/lib/metanorma/document/components/inline/display_text_element.rb +0 -2
  48. data/lib/metanorma/document/components/inline/em_raw_element.rb +0 -2
  49. data/lib/metanorma/document/components/inline/enum_comma_element.rb +0 -2
  50. data/lib/metanorma/document/components/inline/eref_element.rb +0 -2
  51. data/lib/metanorma/document/components/inline/fmt_admitted_element.rb +0 -4
  52. data/lib/metanorma/document/components/inline/fmt_annotation_body_element.rb +0 -4
  53. data/lib/metanorma/document/components/inline/fmt_annotation_end_element.rb +0 -4
  54. data/lib/metanorma/document/components/inline/fmt_annotation_start_element.rb +0 -4
  55. data/lib/metanorma/document/components/inline/fmt_concept_element.rb +0 -4
  56. data/lib/metanorma/document/components/inline/fmt_definition_element.rb +0 -4
  57. data/lib/metanorma/document/components/inline/fmt_fn_body_element.rb +0 -4
  58. data/lib/metanorma/document/components/inline/fmt_fn_label_element.rb +0 -4
  59. data/lib/metanorma/document/components/inline/fmt_footnote_container_element.rb +0 -4
  60. data/lib/metanorma/document/components/inline/fmt_identifier_element.rb +0 -4
  61. data/lib/metanorma/document/components/inline/fmt_name_element.rb +0 -4
  62. data/lib/metanorma/document/components/inline/fmt_preferred_element.rb +0 -4
  63. data/lib/metanorma/document/components/inline/fmt_sourcecode_element.rb +0 -4
  64. data/lib/metanorma/document/components/inline/fmt_stem_element.rb +0 -10
  65. data/lib/metanorma/document/components/inline/fmt_termsource_element.rb +0 -4
  66. data/lib/metanorma/document/components/inline/fmt_title_element.rb +0 -4
  67. data/lib/metanorma/document/components/inline/fmt_xref_element.rb +0 -4
  68. data/lib/metanorma/document/components/inline/fmt_xref_label_element.rb +0 -4
  69. data/lib/metanorma/document/components/inline/fn_element.rb +0 -2
  70. data/lib/metanorma/document/components/inline/link_element.rb +0 -2
  71. data/lib/metanorma/document/components/inline/localized_string_element.rb +0 -2
  72. data/lib/metanorma/document/components/inline/localized_strings_element.rb +0 -2
  73. data/lib/metanorma/document/components/inline/math_element.rb +0 -2
  74. data/lib/metanorma/document/components/inline/name_with_id_element.rb +0 -4
  75. data/lib/metanorma/document/components/inline/semx_child_element.rb +0 -2
  76. data/lib/metanorma/document/components/inline/semx_element.rb +1 -13
  77. data/lib/metanorma/document/components/inline/small_cap_element.rb +0 -2
  78. data/lib/metanorma/document/components/inline/span_element.rb +15 -10
  79. data/lib/metanorma/document/components/inline/stem_inline_element.rb +1 -7
  80. data/lib/metanorma/document/components/inline/strong_raw_element.rb +0 -2
  81. data/lib/metanorma/document/components/inline/sub_element.rb +0 -2
  82. data/lib/metanorma/document/components/inline/sup_element.rb +0 -2
  83. data/lib/metanorma/document/components/inline/tab_element.rb +0 -2
  84. data/lib/metanorma/document/components/inline/title_with_annotation_element.rb +0 -4
  85. data/lib/metanorma/document/components/inline/tt_element.rb +0 -2
  86. data/lib/metanorma/document/components/inline/variant_title_element.rb +0 -2
  87. data/lib/metanorma/document/components/inline/xref_element.rb +0 -10
  88. data/lib/metanorma/document/components/inline.rb +0 -12
  89. data/lib/metanorma/document/components/multi_paragraph/quote_block.rb +29 -0
  90. data/lib/metanorma/document/components/multi_paragraph.rb +0 -2
  91. data/lib/metanorma/document/components/reference_elements/source_element.rb +31 -0
  92. data/lib/metanorma/document/components/reference_elements.rb +2 -2
  93. data/lib/metanorma/document/components/tables/table_block.rb +22 -0
  94. data/lib/metanorma/document/components/tables/table_section.rb +25 -0
  95. data/lib/metanorma/document/components/tables.rb +3 -5
  96. data/lib/metanorma/document/relaton/address.rb +27 -0
  97. data/lib/metanorma/document/relaton/bib_item_locality.rb +12 -3
  98. data/lib/metanorma/document/relaton/copyright_association.rb +10 -0
  99. data/lib/metanorma/document/relaton/edition.rb +7 -4
  100. data/lib/metanorma/document/relaton/organization.rb +14 -0
  101. data/lib/metanorma/document/relaton/phone.rb +9 -3
  102. data/lib/metanorma/document/relaton/place_type.rb +13 -0
  103. data/lib/metanorma/document/relaton/price_type.rb +9 -3
  104. data/lib/metanorma/document/relaton.rb +1 -6
  105. data/lib/metanorma/document/version.rb +1 -1
  106. data/lib/metanorma/document.rb +0 -2
  107. data/lib/metanorma/html/asset_pipeline.rb +0 -1
  108. data/lib/metanorma/html/base_renderer.rb +1008 -261
  109. data/lib/metanorma/html/bipm_renderer.rb +144 -15
  110. data/lib/metanorma/html/cc_renderer.rb +45 -1
  111. data/lib/metanorma/html/component/base.rb +7 -2
  112. data/lib/metanorma/html/component/index_section.rb +43 -41
  113. data/lib/metanorma/html/drops/admonition_drop.rb +4 -1
  114. data/lib/metanorma/html/drops/block_element_drop.rb +2 -7
  115. data/lib/metanorma/html/drops/example_drop.rb +4 -1
  116. data/lib/metanorma/html/drops/figure_drop.rb +22 -31
  117. data/lib/metanorma/html/drops/footnote_drop.rb +1 -1
  118. data/lib/metanorma/html/drops/formula_drop.rb +16 -45
  119. data/lib/metanorma/html/drops/note_drop.rb +7 -9
  120. data/lib/metanorma/html/drops/sourcecode_drop.rb +5 -12
  121. data/lib/metanorma/html/drops.rb +0 -2
  122. data/lib/metanorma/html/generator.rb +2 -2
  123. data/lib/metanorma/html/icc_renderer.rb +39 -0
  124. data/lib/metanorma/html/iec_renderer.rb +44 -1
  125. data/lib/metanorma/html/ieee_renderer.rb +45 -1
  126. data/lib/metanorma/html/ietf_renderer.rb +48 -1
  127. data/lib/metanorma/html/iho_renderer.rb +46 -1
  128. data/lib/metanorma/html/iso_renderer.rb +343 -290
  129. data/lib/metanorma/html/itu_renderer.rb +45 -1
  130. data/lib/metanorma/html/ogc_renderer.rb +76 -15
  131. data/lib/metanorma/html/oiml_renderer.rb +38 -18
  132. data/lib/metanorma/html/pdfa_renderer.rb +39 -0
  133. data/lib/metanorma/html/ribose_renderer.rb +45 -1
  134. data/lib/metanorma/html/standard_renderer.rb +229 -341
  135. data/lib/metanorma/html/templates/_footnotes.html.liquid +6 -6
  136. data/lib/metanorma/html/templates/_formula.html.liquid +1 -1
  137. data/lib/metanorma/html/templates/_header.html.liquid +1 -1
  138. data/lib/metanorma/html/templates/_iso_cover.html.liquid +1 -1
  139. data/lib/metanorma/html/templates/document.html.liquid +0 -4
  140. data/lib/metanorma/html/theme.rb +107 -180
  141. data/lib/metanorma/html.rb +3 -14
  142. data/lib/metanorma/ietf_document/metadata/ietf_bib_data_extension_type.rb +25 -0
  143. data/lib/metanorma/ietf_document/metadata.rb +0 -2
  144. data/lib/metanorma/iso_document/metadata/iso_bib_data_extension_type.rb +48 -0
  145. data/lib/metanorma/iso_document/metadata/iso_bibliographic_item.rb +72 -0
  146. data/lib/metanorma/iso_document/metadata/iso_document_status.rb +30 -0
  147. data/lib/metanorma/iso_document/metadata/iso_localized_title.rb +1 -4
  148. data/lib/metanorma/iso_document/metadata/structured_identifier.rb +17 -0
  149. data/lib/metanorma/iso_document/metadata/title_collection.rb +0 -1
  150. data/lib/metanorma/iso_document/metadata.rb +4 -9
  151. data/lib/metanorma/iso_document/terms/iso_term.rb +13 -0
  152. data/lib/metanorma/iso_document/terms.rb +0 -1
  153. data/lib/metanorma/itu_document/metadata/itu_bib_data_extension_type.rb +37 -0
  154. data/lib/metanorma/itu_document/metadata.rb +4 -3
  155. data/lib/metanorma/standard_document/block_attributes.rb +9 -5
  156. data/lib/metanorma/standard_document/blocks/block_source.rb +23 -0
  157. data/lib/metanorma/standard_document/blocks.rb +1 -1
  158. data/lib/metanorma/standard_document/terms/term_expression.rb +31 -0
  159. data/lib/metanorma/standard_document/terms.rb +0 -1
  160. data/metanorma-document.gemspec +35 -0
  161. metadata +13 -262
  162. data/CLAUDE.md +0 -26
  163. data/TODO.finalize/01-split-multi-class-files.md +0 -8
  164. data/TODO.finalize/02-remove-data-dist-iso-document-frontend.md +0 -6
  165. data/TODO.finalize/03-align-frontend-iife-and-gha-build.md +0 -11
  166. data/TODO.finalize/04-theme-per-flavor-config-driven.md +0 -9
  167. data/TODO.finalize/05-migrate-all-html-to-liquid.md +0 -16
  168. data/TODO.finalize/06-integrate-pubid-library.md +0 -16
  169. data/TODO.finalize/07-replace-relaton-models-with-relaton-bib.md +0 -39
  170. data/TODO.finalize/08-refactor-renderer-architecture.md +0 -25
  171. data/TODO.finalize/09-eliminate-code-smells.md +0 -14
  172. data/TODO.finalize/10-comprehensive-spec-coverage.md +0 -24
  173. data/TODO.finalize/11-config-driven-flavor-metadata.md +0 -20
  174. data/TODO.finalize/12-add-frozen-string-literal.md +0 -6
  175. data/TODO.finalize/13-extract-composition-from-god-class.md +0 -96
  176. data/TODO.finalize/14-config-driven-section-ordering.md +0 -31
  177. data/TODO.finalize/15-theme-directories-per-flavor.md +0 -46
  178. data/TODO.finalize/16-theme-lutaml-model-schema.md +0 -44
  179. data/data/javascripts/components/mn-footnotes.js +0 -68
  180. data/data/logos/oiml-logo-full-dark.svg +0 -1
  181. data/data/logos/oiml-logo-full-light.svg +0 -1
  182. data/data/logos/oiml-logo-icon-dark.svg +0 -1
  183. data/data/logos/oiml-logo-icon-light.svg +0 -1
  184. data/data/logos/oiml-logo.svg +0 -1
  185. data/data/themes/bipm.yaml +0 -60
  186. data/data/themes/cc.yaml +0 -43
  187. data/data/themes/icc.yaml +0 -39
  188. data/data/themes/iec.yaml +0 -44
  189. data/data/themes/ieee.yaml +0 -43
  190. data/data/themes/ietf.yaml +0 -45
  191. data/data/themes/iho.yaml +0 -46
  192. data/data/themes/iso.yaml +0 -40
  193. data/data/themes/itu.yaml +0 -45
  194. data/data/themes/ogc.yaml +0 -51
  195. data/data/themes/oiml.yaml +0 -56
  196. data/data/themes/pdfa.yaml +0 -44
  197. data/data/themes/ribose.yaml +0 -43
  198. data/exe/metanorma-document +0 -11
  199. data/frontend/e2e/sample-html.test.ts +0 -256
  200. data/frontend/index.html +0 -12
  201. data/frontend/package-lock.json +0 -4725
  202. data/frontend/package.json +0 -32
  203. data/frontend/postcss.config.js +0 -6
  204. data/frontend/src/App.vue +0 -79
  205. data/frontend/src/app.ts +0 -21
  206. data/frontend/src/components/AppSidebar.vue +0 -77
  207. data/frontend/src/components/DocumentReader.vue +0 -180
  208. data/frontend/src/components/MirrorRenderer.vue +0 -23
  209. data/frontend/src/components/ReadingProgressBar.vue +0 -29
  210. data/frontend/src/components/TextRenderer.vue +0 -131
  211. data/frontend/src/components/TocItem.vue +0 -57
  212. data/frontend/src/components/TopBar.vue +0 -49
  213. data/frontend/src/components/__tests__/MirrorRenderer.test.ts +0 -178
  214. data/frontend/src/components/blocks/AdmonitionBlock.vue +0 -74
  215. data/frontend/src/components/blocks/ClauseBlock.vue +0 -53
  216. data/frontend/src/components/blocks/ExampleBlock.vue +0 -21
  217. data/frontend/src/components/blocks/FallbackBlock.vue +0 -18
  218. data/frontend/src/components/blocks/FigureBlock.vue +0 -26
  219. data/frontend/src/components/blocks/FootnotesBlock.vue +0 -25
  220. data/frontend/src/components/blocks/ListBlocks.vue +0 -62
  221. data/frontend/src/components/blocks/NoteBlock.vue +0 -21
  222. data/frontend/src/components/blocks/ParagraphBlock.vue +0 -25
  223. data/frontend/src/components/blocks/QuoteBlock.vue +0 -25
  224. data/frontend/src/components/blocks/ReviewBlock.vue +0 -39
  225. data/frontend/src/components/blocks/SourcecodeBlock.vue +0 -52
  226. data/frontend/src/components/blocks/TableBlock.vue +0 -48
  227. data/frontend/src/components/blocks/index.ts +0 -36
  228. data/frontend/src/stores/__tests__/documentStore.fixture.test.ts +0 -272
  229. data/frontend/src/stores/__tests__/documentStore.test.ts +0 -143
  230. data/frontend/src/stores/__tests__/ebookStore.test.ts +0 -145
  231. data/frontend/src/stores/__tests__/uiStore.test.ts +0 -42
  232. data/frontend/src/stores/documentStore.ts +0 -153
  233. data/frontend/src/stores/ebookStore.ts +0 -179
  234. data/frontend/src/stores/uiStore.ts +0 -32
  235. data/frontend/src/styles.css +0 -156
  236. data/frontend/src/types/__tests__/rendering-contract.test.ts +0 -172
  237. data/frontend/src/types/rendering-contract.ts +0 -209
  238. data/frontend/src/utils/__tests__/typeMetadata.test.ts +0 -102
  239. data/frontend/src/utils/typeMetadata.ts +0 -121
  240. data/frontend/tailwind.config.js +0 -18
  241. data/frontend/test/fixtures/iso-document.json +0 -271
  242. data/frontend/tmp/debug_e2e.cjs +0 -46
  243. data/frontend/tsconfig.json +0 -25
  244. data/frontend/tsconfig.node.json +0 -11
  245. data/frontend/vite.config.ts +0 -37
  246. data/frontend/vitest.e2e.config.ts +0 -9
  247. data/lib/metanorma/bipm_document/metadata/depiction_element.rb +0 -18
  248. data/lib/metanorma/document/cli.rb +0 -116
  249. data/lib/metanorma/document/components/ancillary_blocks/callout_annotation.rb +0 -27
  250. data/lib/metanorma/document/components/ancillary_blocks/sourcecode_body.rb +0 -18
  251. data/lib/metanorma/document/components/blocks/classification_value.rb +0 -21
  252. data/lib/metanorma/document/components/blocks/permission_model.rb +0 -28
  253. data/lib/metanorma/document/components/blocks/recommendation_model.rb +0 -28
  254. data/lib/metanorma/document/components/blocks/requirement_base.rb +0 -30
  255. data/lib/metanorma/document/components/blocks/requirement_classification.rb +0 -20
  256. data/lib/metanorma/document/components/blocks/requirement_description.rb +0 -43
  257. data/lib/metanorma/document/components/blocks/requirement_inherit.rb +0 -24
  258. data/lib/metanorma/document/components/inline/location_element.rb +0 -24
  259. data/lib/metanorma/document/components/inline/rendered_display.rb +0 -23
  260. data/lib/metanorma/document/components/inline/rendered_math_element.rb +0 -21
  261. data/lib/metanorma/document/components/inline/semantic_content.rb +0 -51
  262. data/lib/metanorma/document/components/inline/semantic_math_element.rb +0 -20
  263. data/lib/metanorma/document/components/inline/vocabulary.rb +0 -184
  264. data/lib/metanorma/document/components/multi_paragraph/quote_author_element.rb +0 -20
  265. data/lib/metanorma/document/components/reference_elements/source_modification.rb +0 -21
  266. data/lib/metanorma/document/components/reference_elements/source_origin.rb +0 -28
  267. data/lib/metanorma/document/components/tables/col_element.rb +0 -18
  268. data/lib/metanorma/document/components/tables/col_group_element.rb +0 -18
  269. data/lib/metanorma/document/components/tables/table_body_section.rb +0 -16
  270. data/lib/metanorma/document/components/tables/table_foot_section.rb +0 -16
  271. data/lib/metanorma/document/components/tables/table_head_section.rb +0 -16
  272. data/lib/metanorma/document/relaton/copyright_owner.rb +0 -16
  273. data/lib/metanorma/document/relaton/formatted_address.rb +0 -29
  274. data/lib/metanorma/document/relaton/logo_element.rb +0 -18
  275. data/lib/metanorma/document/relaton/region_element.rb +0 -18
  276. data/lib/metanorma/html/drops/biblio_entry_drop.rb +0 -50
  277. data/lib/metanorma/html/renderers/block_renderer.rb +0 -372
  278. data/lib/metanorma/html/renderers/inline_renderer.rb +0 -655
  279. data/lib/metanorma/html/renderers/pubid_renderer.rb +0 -69
  280. data/lib/metanorma/html/renderers/section_renderer.rb +0 -193
  281. data/lib/metanorma/html/renderers.rb +0 -8
  282. data/lib/metanorma/html/templates/_audio.html.liquid +0 -1
  283. data/lib/metanorma/html/templates/_biblio_entry.html.liquid +0 -1
  284. data/lib/metanorma/html/templates/_bipm_cover.html.liquid +0 -27
  285. data/lib/metanorma/html/templates/_boilerplate.html.liquid +0 -1
  286. data/lib/metanorma/html/templates/_bookmark.html.liquid +0 -1
  287. data/lib/metanorma/html/templates/_br.html.liquid +0 -1
  288. data/lib/metanorma/html/templates/_definition_list.html.liquid +0 -6
  289. data/lib/metanorma/html/templates/_element.html.liquid +0 -1
  290. data/lib/metanorma/html/templates/_fn_marker.html.liquid +0 -1
  291. data/lib/metanorma/html/templates/_heading.html.liquid +0 -1
  292. data/lib/metanorma/html/templates/_image.html.liquid +0 -1
  293. data/lib/metanorma/html/templates/_inline_span.html.liquid +0 -1
  294. data/lib/metanorma/html/templates/_link.html.liquid +0 -1
  295. data/lib/metanorma/html/templates/_list.html.liquid +0 -3
  296. data/lib/metanorma/html/templates/_list_item.html.liquid +0 -1
  297. data/lib/metanorma/html/templates/_main_content.html.liquid +0 -1
  298. data/lib/metanorma/html/templates/_math_container.html.liquid +0 -1
  299. data/lib/metanorma/html/templates/_paragraph.html.liquid +0 -1
  300. data/lib/metanorma/html/templates/_prefatory_section.html.liquid +0 -1
  301. data/lib/metanorma/html/templates/_pubid_identifier.html.liquid +0 -1
  302. data/lib/metanorma/html/templates/_quote.html.liquid +0 -4
  303. data/lib/metanorma/html/templates/_ref_date.html.liquid +0 -1
  304. data/lib/metanorma/html/templates/_ref_title.html.liquid +0 -1
  305. data/lib/metanorma/html/templates/_section.html.liquid +0 -5
  306. data/lib/metanorma/html/templates/_standard_cover.html.liquid +0 -31
  307. data/lib/metanorma/html/templates/_standard_doc_title.html.liquid +0 -3
  308. data/lib/metanorma/html/templates/_stem_span.html.liquid +0 -1
  309. data/lib/metanorma/html/templates/_table.html.liquid +0 -9
  310. data/lib/metanorma/html/templates/_term_domain.html.liquid +0 -1
  311. data/lib/metanorma/html/templates/_term_example.html.liquid +0 -1
  312. data/lib/metanorma/html/templates/_term_note.html.liquid +0 -1
  313. data/lib/metanorma/html/templates/_term_number.html.liquid +0 -1
  314. data/lib/metanorma/html/templates/_term_source.html.liquid +0 -1
  315. data/lib/metanorma/html/templates/_term_text_note.html.liquid +0 -1
  316. data/lib/metanorma/html/templates/_video.html.liquid +0 -1
  317. data/lib/metanorma/html/templates/_wrapped_preface.html.liquid +0 -1
  318. data/lib/metanorma/ietf_document/metadata/pi_settings.rb +0 -32
  319. data/lib/metanorma/iso_document/metadata/doctype_element.rb +0 -20
  320. data/lib/metanorma/iso_document/metadata/language_element.rb +0 -18
  321. data/lib/metanorma/iso_document/metadata/project_number.rb +0 -22
  322. data/lib/metanorma/iso_document/metadata/script_element.rb +0 -18
  323. data/lib/metanorma/iso_document/metadata/stage_element.rb +0 -26
  324. data/lib/metanorma/iso_document/metadata/stagename_element.rb +0 -18
  325. data/lib/metanorma/iso_document/terms/term_domain_element.rb +0 -18
  326. data/lib/metanorma/itu_document/metadata/meeting_date.rb +0 -18
  327. data/lib/metanorma/itu_document/metadata/meeting_element.rb +0 -18
  328. data/lib/metanorma/itu_document/metadata/study_period.rb +0 -18
  329. data/lib/metanorma/mirror/default_registry.rb +0 -170
  330. data/lib/metanorma/mirror/handler_registry.rb +0 -60
  331. data/lib/metanorma/mirror/handler_result.rb +0 -37
  332. data/lib/metanorma/mirror/handlers/admonition.rb +0 -18
  333. data/lib/metanorma/mirror/handlers/example.rb +0 -21
  334. data/lib/metanorma/mirror/handlers/figure.rb +0 -53
  335. data/lib/metanorma/mirror/handlers/formula.rb +0 -35
  336. data/lib/metanorma/mirror/handlers/inline/rich_html_renderer.rb +0 -159
  337. data/lib/metanorma/mirror/handlers/inline/text_extractor.rb +0 -116
  338. data/lib/metanorma/mirror/handlers/inline.rb +0 -225
  339. data/lib/metanorma/mirror/handlers/list.rb +0 -110
  340. data/lib/metanorma/mirror/handlers/note.rb +0 -26
  341. data/lib/metanorma/mirror/handlers/paragraph.rb +0 -19
  342. data/lib/metanorma/mirror/handlers/quote.rb +0 -16
  343. data/lib/metanorma/mirror/handlers/review.rb +0 -19
  344. data/lib/metanorma/mirror/handlers/section.rb +0 -149
  345. data/lib/metanorma/mirror/handlers/sourcecode.rb +0 -27
  346. data/lib/metanorma/mirror/handlers/structural.rb +0 -68
  347. data/lib/metanorma/mirror/handlers/table.rb +0 -81
  348. data/lib/metanorma/mirror/handlers/term.rb +0 -100
  349. data/lib/metanorma/mirror/handlers.rb +0 -60
  350. data/lib/metanorma/mirror/id_strategy/positional.rb +0 -166
  351. data/lib/metanorma/mirror/id_strategy/preserve.rb +0 -12
  352. data/lib/metanorma/mirror/id_strategy.rb +0 -34
  353. data/lib/metanorma/mirror/math_util.rb +0 -53
  354. data/lib/metanorma/mirror/metadata.rb +0 -37
  355. data/lib/metanorma/mirror/metanorma_to_mirror.rb +0 -101
  356. data/lib/metanorma/mirror/model/container.rb +0 -47
  357. data/lib/metanorma/mirror/model/factory.rb +0 -52
  358. data/lib/metanorma/mirror/model/guide.rb +0 -25
  359. data/lib/metanorma/mirror/model/leaf.rb +0 -17
  360. data/lib/metanorma/mirror/model/mark.rb +0 -53
  361. data/lib/metanorma/mirror/model/node.rb +0 -47
  362. data/lib/metanorma/mirror/model/soft_break.rb +0 -33
  363. data/lib/metanorma/mirror/model/text.rb +0 -34
  364. data/lib/metanorma/mirror/model.rb +0 -16
  365. data/lib/metanorma/mirror/output/builder.rb +0 -39
  366. data/lib/metanorma/mirror/output/formats/base_format.rb +0 -90
  367. data/lib/metanorma/mirror/output/formats/inline_format.rb +0 -81
  368. data/lib/metanorma/mirror/output/formats.rb +0 -53
  369. data/lib/metanorma/mirror/output/html_renderer.rb +0 -95
  370. data/lib/metanorma/mirror/output/html_renderers/block_renderers.rb +0 -178
  371. data/lib/metanorma/mirror/output/html_renderers/inline_renderer.rb +0 -61
  372. data/lib/metanorma/mirror/output/html_renderers/list_renderers.rb +0 -96
  373. data/lib/metanorma/mirror/output/html_renderers/mark_renderers.rb +0 -64
  374. data/lib/metanorma/mirror/output/html_renderers/section_renderers.rb +0 -129
  375. data/lib/metanorma/mirror/output/html_renderers/structural_renderers.rb +0 -80
  376. data/lib/metanorma/mirror/output/html_renderers/table_renderers.rb +0 -87
  377. data/lib/metanorma/mirror/output/html_renderers.rb +0 -76
  378. data/lib/metanorma/mirror/output/pipeline.rb +0 -92
  379. data/lib/metanorma/mirror/output/pipeline_context.rb +0 -22
  380. data/lib/metanorma/mirror/output.rb +0 -14
  381. data/lib/metanorma/mirror/rewriter.rb +0 -121
  382. data/lib/metanorma/mirror/safe_attr.rb +0 -16
  383. data/lib/metanorma/mirror/serialization/json_serializer.rb +0 -25
  384. data/lib/metanorma/mirror/serialization/yaml_serializer.rb +0 -20
  385. data/lib/metanorma/mirror/serialization.rb +0 -10
  386. data/lib/metanorma/mirror/transformer.rb +0 -22
  387. data/lib/metanorma/mirror.rb +0 -32
  388. data/lib/metanorma/standard_document/annotation.rb +0 -37
  389. data/lib/metanorma/standard_document/blocks/source_origin_element.rb +0 -23
  390. data/lib/metanorma/standard_document/terms/term_name_element.rb +0 -29
  391. data/script/render_both.rb +0 -18
@@ -1,145 +0,0 @@
1
- import { describe, it, expect, beforeEach } from 'vitest'
2
- import { nextTick } from 'vue'
3
- import { setActivePinia, createPinia } from 'pinia'
4
- import { useEbookStore } from '../ebookStore'
5
-
6
- describe('useEbookStore', () => {
7
- beforeEach(() => {
8
- localStorage.clear()
9
- setActivePinia(createPinia())
10
- })
11
-
12
- it('has correct defaults', () => {
13
- const store = useEbookStore()
14
- expect(store.fontSize).toBe(18)
15
- expect(store.fontFamily).toBe('sans')
16
- expect(store.contentWidth).toBe('default')
17
- expect(store.theme).toBe('day')
18
- expect(store.lineHeight).toBe('comfortable')
19
- expect(store.showProgress).toBe(true)
20
- expect(store.readingMode).toBe('scroll')
21
- })
22
-
23
- it('sets font size with clamping', () => {
24
- const store = useEbookStore()
25
- store.setFontSize(20)
26
- expect(store.fontSize).toBe(20)
27
- store.setFontSize(5)
28
- expect(store.fontSize).toBe(12)
29
- store.setFontSize(100)
30
- expect(store.fontSize).toBe(32)
31
- })
32
-
33
- it('sets font family', () => {
34
- const store = useEbookStore()
35
- store.setFontFamily('serif')
36
- expect(store.fontFamily).toBe('serif')
37
- })
38
-
39
- it('sets content width', () => {
40
- const store = useEbookStore()
41
- store.setContentWidth('wide')
42
- expect(store.contentWidth).toBe('wide')
43
- })
44
-
45
- it('sets theme', () => {
46
- const store = useEbookStore()
47
- store.setTheme('night')
48
- expect(store.theme).toBe('night')
49
- })
50
-
51
- it('cycles through themes', () => {
52
- const store = useEbookStore()
53
- expect(store.theme).toBe('day')
54
- store.cycleTheme()
55
- expect(store.theme).toBe('sepia')
56
- store.cycleTheme()
57
- expect(store.theme).toBe('night')
58
- store.cycleTheme()
59
- expect(store.theme).toBe('oled')
60
- store.cycleTheme()
61
- expect(store.theme).toBe('day')
62
- })
63
-
64
- it('sets line height', () => {
65
- const store = useEbookStore()
66
- store.setLineHeight('spacious')
67
- expect(store.lineHeight).toBe('spacious')
68
- })
69
-
70
- it('toggles focus mode', () => {
71
- const store = useEbookStore()
72
- store.setFocusMode(true)
73
- expect(store.focusMode).toBe(true)
74
- store.toggleFocusMode()
75
- expect(store.focusMode).toBe(false)
76
- })
77
-
78
- it('toggles settings panel', () => {
79
- const store = useEbookStore()
80
- expect(store.settingsOpen).toBe(false)
81
- store.toggleSettings()
82
- expect(store.settingsOpen).toBe(true)
83
- expect(store.tocOpen).toBe(false)
84
- })
85
-
86
- it('toggles toc panel', () => {
87
- const store = useEbookStore()
88
- store.toggleToc()
89
- expect(store.tocOpen).toBe(true)
90
- expect(store.settingsOpen).toBe(false)
91
- })
92
-
93
- it('closeAll closes both panels', () => {
94
- const store = useEbookStore()
95
- store.toggleSettings()
96
- store.closeAll()
97
- expect(store.settingsOpen).toBe(false)
98
- expect(store.tocOpen).toBe(false)
99
- })
100
-
101
- it('returns theme class', () => {
102
- const store = useEbookStore()
103
- expect(store.getThemeClass()).toBe('theme-day')
104
- store.setTheme('night')
105
- expect(store.getThemeClass()).toBe('theme-night')
106
- })
107
-
108
- it('returns CSS variables', () => {
109
- const store = useEbookStore()
110
- const vars = store.getCssVariables()
111
- expect(vars['--ebook-font-size']).toBe('18px')
112
- expect(vars['--ebook-max-width']).toBe('58rem')
113
- expect(vars['--ebook-line-height']).toBe('1.6')
114
- })
115
-
116
- it('CSS variables reflect focus mode', () => {
117
- const store = useEbookStore()
118
- store.setFocusMode(true)
119
- const vars = store.getCssVariables()
120
- expect(vars['--ebook-max-width']).toBe('100%')
121
- })
122
-
123
- it('persists preferences to localStorage', async () => {
124
- const store = useEbookStore()
125
- store.setTheme('night')
126
- store.setFontSize(24)
127
- await nextTick()
128
-
129
- const stored = JSON.parse(localStorage.getItem('metanorma_ebook_preferences')!)
130
- expect(stored.theme).toBe('night')
131
- expect(stored.fontSize).toBe(24)
132
- })
133
-
134
- it('loads preferences from localStorage', () => {
135
- localStorage.setItem('metanorma_ebook_preferences', JSON.stringify({
136
- theme: 'sepia',
137
- fontSize: 22,
138
- }))
139
-
140
- setActivePinia(createPinia())
141
- const store = useEbookStore()
142
- expect(store.theme).toBe('sepia')
143
- expect(store.fontSize).toBe(22)
144
- })
145
- })
@@ -1,42 +0,0 @@
1
- import { describe, it, expect, beforeEach } from 'vitest'
2
- import { setActivePinia, createPinia } from 'pinia'
3
- import { useUiStore } from '../uiStore'
4
-
5
- describe('useUiStore', () => {
6
- beforeEach(() => {
7
- setActivePinia(createPinia())
8
- })
9
-
10
- it('has correct defaults', () => {
11
- const store = useUiStore()
12
- expect(store.sidebarOpen).toBe(false)
13
- expect(store.activeSectionId).toBeNull()
14
- })
15
-
16
- it('opens sidebar', () => {
17
- const store = useUiStore()
18
- store.openSidebar()
19
- expect(store.sidebarOpen).toBe(true)
20
- })
21
-
22
- it('closes sidebar', () => {
23
- const store = useUiStore()
24
- store.openSidebar()
25
- store.closeSidebar()
26
- expect(store.sidebarOpen).toBe(false)
27
- })
28
-
29
- it('toggles sidebar', () => {
30
- const store = useUiStore()
31
- store.toggleSidebar()
32
- expect(store.sidebarOpen).toBe(true)
33
- store.toggleSidebar()
34
- expect(store.sidebarOpen).toBe(false)
35
- })
36
-
37
- it('sets active section', () => {
38
- const store = useUiStore()
39
- store.setActiveSection('scope')
40
- expect(store.activeSectionId).toBe('scope')
41
- })
42
- })
@@ -1,153 +0,0 @@
1
- import { defineStore } from 'pinia'
2
- import { ref, shallowRef, computed } from 'vue'
3
-
4
- // ============================================================
5
- // MetanormaMirror (ProseMirror-style) Types
6
- // ============================================================
7
-
8
- export interface MirrorMark {
9
- type: 'emphasis' | 'strong' | 'subscript' | 'superscript' | 'code'
10
- | 'underline' | 'strike' | 'smallcap' | 'link' | 'xref'
11
- | 'eref' | 'footnote' | 'stem' | 'concept' | 'bcp14' | 'span'
12
- attrs?: Record<string, any>
13
- }
14
-
15
- export interface MirrorTextNode {
16
- type: 'text'
17
- text: string
18
- marks?: MirrorMark[]
19
- }
20
-
21
- export interface MirrorBlockNode {
22
- type: string
23
- attrs?: Record<string, any>
24
- content?: (MirrorTextNode | MirrorBlockNode)[]
25
- }
26
-
27
- export interface MirrorDocument {
28
- type: 'doc'
29
- attrs?: Record<string, any>
30
- content?: MirrorBlockNode[]
31
- }
32
-
33
- // ============================================================
34
- // TOC Types
35
- // ============================================================
36
-
37
- export interface TocItem {
38
- id: string
39
- title: string
40
- type: string
41
- children: TocItem[]
42
- number?: string
43
- }
44
-
45
- interface DocumentMeta {
46
- title?: string
47
- flavor?: string
48
- docType?: string
49
- schemaVersion?: string
50
- sections: TocItem[]
51
- numbering: Record<string, string>
52
- }
53
-
54
- // ============================================================
55
- // Document Store
56
- // ============================================================
57
-
58
- export const useDocumentStore = defineStore('document', () => {
59
- const documentMeta = ref<DocumentMeta | null>(null)
60
- const mirrorDocument = shallowRef<MirrorDocument | null>(null)
61
- const loadError = ref<string | null>(null)
62
-
63
- function processMetanormaData(data: any): void {
64
- if (data.type === 'doc' && Array.isArray(data.content)) {
65
- mirrorDocument.value = data as MirrorDocument
66
-
67
- if (data.toc?.sections) {
68
- documentMeta.value = {
69
- title: data.meta?.title || data.attrs?.title,
70
- flavor: data.meta?.flavor || data.attrs?.flavor,
71
- docType: data.meta?.type || data.attrs?.type,
72
- schemaVersion: data.meta?.schema_version || data.attrs?.schema_version,
73
- sections: data.toc.sections,
74
- numbering: data.toc.numbering || {},
75
- }
76
- } else {
77
- documentMeta.value = {
78
- title: data.meta?.title || data.attrs?.title,
79
- flavor: data.meta?.flavor || data.attrs?.flavor,
80
- docType: data.meta?.type || data.attrs?.type,
81
- schemaVersion: data.meta?.schema_version || data.attrs?.schema_version,
82
- sections: extractToc(data.content),
83
- numbering: {},
84
- }
85
- }
86
- }
87
- }
88
-
89
- function extractToc(nodes: any[]): TocItem[] {
90
- const sectionTypes = new Set([
91
- 'clause', 'annex', 'terms', 'definitions', 'references',
92
- 'abstract', 'foreword', 'introduction', 'acknowledgements',
93
- ])
94
- const items: TocItem[] = []
95
- for (const node of nodes) {
96
- if (sectionTypes.has(node.type) && node.attrs?.id) {
97
- items.push({
98
- id: node.attrs.id,
99
- title: node.attrs.title || node.type,
100
- type: node.type,
101
- children: node.content ? extractToc(node.content) : [],
102
- })
103
- }
104
- }
105
- return items
106
- }
107
-
108
- function loadFromWindow(): void {
109
- loadError.value = null
110
- const data = (window as any).METANORMA_DATA
111
- if (data) {
112
- processMetanormaData(data)
113
- delete (window as any).METANORMA_DATA
114
- } else {
115
- fetch('metanorma.data.json')
116
- .then(res => {
117
- if (!res.ok) throw new Error('Failed to load metanorma.data.json')
118
- return res.json()
119
- })
120
- .then(data => processMetanormaData(data))
121
- .catch(err => {
122
- console.error('Failed to load document data:', err)
123
- loadError.value = err instanceof Error ? err.message : 'Failed to load document'
124
- })
125
- }
126
- }
127
-
128
- const title = computed(() => {
129
- return documentMeta.value?.title || mirrorDocument.value?.attrs?.title || 'Metanorma Document'
130
- })
131
- const flavor = computed(() => documentMeta.value?.flavor || '')
132
- const docType = computed(() => documentMeta.value?.docType || '')
133
- const sections = computed(() => documentMeta.value?.sections || [])
134
- const numbering = computed(() => documentMeta.value?.numbering || {})
135
-
136
- function getNumbering(id: string): string {
137
- return numbering.value[id] || ''
138
- }
139
-
140
- return {
141
- documentMeta,
142
- mirrorDocument,
143
- loadError,
144
- loadFromWindow,
145
- processMetanormaData,
146
- title,
147
- flavor,
148
- docType,
149
- sections,
150
- numbering,
151
- getNumbering,
152
- }
153
- })
@@ -1,179 +0,0 @@
1
- import { defineStore } from 'pinia'
2
- import { ref, watch } from 'vue'
3
-
4
- export type Theme = 'day' | 'sepia' | 'night' | 'oled'
5
- export type FontFamily = 'sans' | 'serif'
6
- export type ContentWidth = 'narrow' | 'default' | 'wide'
7
- export type LineHeight = 'compact' | 'comfortable' | 'relaxed' | 'spacious'
8
- export type ReadingMode = 'scroll' | 'paged'
9
-
10
- const STORAGE_KEY = 'metanorma_ebook_preferences'
11
-
12
- export const CONTENT_WIDTHS: Record<ContentWidth, string> = {
13
- narrow: '38rem',
14
- default: '58rem',
15
- wide: '82rem',
16
- }
17
-
18
- export const LINE_HEIGHTS: Record<LineHeight, string> = {
19
- compact: '1.4',
20
- comfortable: '1.6',
21
- relaxed: '1.8',
22
- spacious: '2.0',
23
- }
24
-
25
- const DEFAULTS = {
26
- fontSize: 18,
27
- fontFamily: 'sans' as FontFamily,
28
- contentWidth: 'default' as ContentWidth,
29
- theme: 'day' as Theme,
30
- lineHeight: 'comfortable' as LineHeight,
31
- readingMode: 'scroll' as ReadingMode,
32
- showProgress: true,
33
- }
34
-
35
- function loadPreferences(): Partial<typeof DEFAULTS> {
36
- try {
37
- const stored = localStorage.getItem(STORAGE_KEY)
38
- if (stored) return JSON.parse(stored)
39
- } catch {}
40
- return {}
41
- }
42
-
43
- function savePreferences(prefs: Record<string, unknown>) {
44
- try {
45
- localStorage.setItem(STORAGE_KEY, JSON.stringify(prefs))
46
- } catch {}
47
- }
48
-
49
- function applyThemeClass(theme: Theme) {
50
- const html = document.documentElement
51
- html.classList.remove('theme-day', 'theme-sepia', 'theme-night', 'theme-oled')
52
- html.classList.add(`theme-${theme}`)
53
- const isDark = theme === 'night' || theme === 'oled'
54
- html.classList.toggle('dark', isDark)
55
- }
56
-
57
- const THEME_ORDER: Theme[] = ['day', 'sepia', 'night', 'oled']
58
-
59
- export const useEbookStore = defineStore('ebook', () => {
60
- const prefs = loadPreferences()
61
-
62
- const fontSize = ref(prefs.fontSize ?? DEFAULTS.fontSize)
63
- const fontFamily = ref<FontFamily>(prefs.fontFamily ?? DEFAULTS.fontFamily)
64
- const contentWidth = ref<ContentWidth>(prefs.contentWidth ?? DEFAULTS.contentWidth)
65
- const theme = ref<Theme>(prefs.theme ?? DEFAULTS.theme)
66
- const lineHeight = ref<LineHeight>(prefs.lineHeight ?? DEFAULTS.lineHeight)
67
- const showProgress = ref(prefs.showProgress ?? DEFAULTS.showProgress)
68
- const readingMode = ref<ReadingMode>(prefs.readingMode ?? DEFAULTS.readingMode)
69
-
70
- const uiVisible = ref(true)
71
- const tocOpen = ref(false)
72
- const settingsOpen = ref(false)
73
- const focusMode = ref(false)
74
-
75
- applyThemeClass(theme.value)
76
-
77
- if (typeof document !== 'undefined') {
78
- document.body.classList.toggle('font-serif', fontFamily.value === 'serif')
79
- document.body.classList.toggle('font-sans', fontFamily.value === 'sans')
80
- }
81
-
82
- watch(
83
- [fontSize, fontFamily, contentWidth, theme, lineHeight, showProgress, readingMode],
84
- () => {
85
- savePreferences({
86
- fontSize: fontSize.value,
87
- fontFamily: fontFamily.value,
88
- contentWidth: contentWidth.value,
89
- theme: theme.value,
90
- lineHeight: lineHeight.value,
91
- showProgress: showProgress.value,
92
- readingMode: readingMode.value,
93
- })
94
- },
95
- { immediate: true }
96
- )
97
-
98
- watch(() => theme.value, (t) => applyThemeClass(t))
99
-
100
- function setFontSize(size: number) {
101
- fontSize.value = Math.max(12, Math.min(32, size))
102
- }
103
-
104
- function setFontFamily(f: FontFamily) {
105
- fontFamily.value = f
106
- document.body.classList.toggle('font-serif', f === 'serif')
107
- document.body.classList.toggle('font-sans', f === 'sans')
108
- }
109
-
110
- function setContentWidth(w: ContentWidth) {
111
- contentWidth.value = w
112
- }
113
-
114
- function setTheme(t: Theme) {
115
- theme.value = t
116
- applyThemeClass(t)
117
- }
118
-
119
- function cycleTheme() {
120
- const nextIndex = (THEME_ORDER.indexOf(theme.value) + 1) % THEME_ORDER.length
121
- setTheme(THEME_ORDER[nextIndex])
122
- }
123
-
124
- function setLineHeight(lh: LineHeight) {
125
- lineHeight.value = lh
126
- }
127
-
128
- function setFocusMode(fm: boolean) {
129
- focusMode.value = fm
130
- }
131
-
132
- function toggleFocusMode() {
133
- focusMode.value = !focusMode.value
134
- }
135
-
136
- function toggleToc() {
137
- tocOpen.value = !tocOpen.value
138
- if (tocOpen.value) settingsOpen.value = false
139
- }
140
-
141
- function toggleSettings() {
142
- settingsOpen.value = !settingsOpen.value
143
- if (settingsOpen.value) tocOpen.value = false
144
- }
145
-
146
- function closeAll() {
147
- tocOpen.value = false
148
- settingsOpen.value = false
149
- }
150
-
151
- function applyTheme() {
152
- applyThemeClass(theme.value)
153
- }
154
-
155
- function getThemeClass(): string {
156
- return `theme-${theme.value}`
157
- }
158
-
159
- function getCssVariables(): Record<string, string> {
160
- return {
161
- '--ebook-font-size': `${fontSize.value}px`,
162
- '--ebook-max-width': focusMode.value ? '100%' : CONTENT_WIDTHS[contentWidth.value],
163
- '--ebook-line-height': LINE_HEIGHTS[lineHeight.value],
164
- }
165
- }
166
-
167
- return {
168
- fontSize, fontFamily, contentWidth, theme,
169
- lineHeight, showProgress, readingMode,
170
- uiVisible, tocOpen, settingsOpen, focusMode,
171
-
172
- setFontSize, setFontFamily, setContentWidth, setTheme,
173
- cycleTheme, setLineHeight, setFocusMode, toggleFocusMode,
174
- toggleToc, toggleSettings, closeAll, applyTheme,
175
-
176
- getThemeClass, getCssVariables,
177
- CONTENT_WIDTHS, LINE_HEIGHTS,
178
- }
179
- })
@@ -1,32 +0,0 @@
1
- import { defineStore } from 'pinia'
2
- import { ref } from 'vue'
3
-
4
- export const useUiStore = defineStore('ui', () => {
5
- const sidebarOpen = ref(false)
6
- const activeSectionId = ref<string | null>(null)
7
-
8
- function openSidebar() {
9
- sidebarOpen.value = true
10
- }
11
-
12
- function closeSidebar() {
13
- sidebarOpen.value = false
14
- }
15
-
16
- function toggleSidebar() {
17
- sidebarOpen.value = !sidebarOpen.value
18
- }
19
-
20
- function setActiveSection(id: string) {
21
- activeSectionId.value = id
22
- }
23
-
24
- return {
25
- sidebarOpen,
26
- activeSectionId,
27
- openSidebar,
28
- closeSidebar,
29
- toggleSidebar,
30
- setActiveSection,
31
- }
32
- })
@@ -1,156 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- * { box-sizing: border-box; }
6
- html { scroll-behavior: smooth; }
7
-
8
- @media (prefers-reduced-motion: reduce) {
9
- html { scroll-behavior: auto; }
10
- *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
11
- }
12
-
13
- body { font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; background-color: var(--ebook-bg, #ffffff); color: var(--ebook-text, #1a1a1a); transition: background-color 0.25s ease, color 0.25s ease; }
14
- body.font-serif { font-family: 'Merriweather', Georgia, serif; }
15
- body.font-sans { font-family: 'Inter', system-ui, sans-serif; }
16
- .font-mono { font-family: ui-monospace, monospace; }
17
-
18
- .dark { color-scheme: dark; }
19
-
20
- /* ============================================================
21
- Theme: Day (default)
22
- ============================================================ */
23
- :root, .theme-day {
24
- --chrome-bg: #ffffff;
25
- --chrome-bg-glass: rgba(255, 255, 255, 0.85);
26
- --chrome-bg-hover: #f1f5f9;
27
- --chrome-border: #e2e8f0;
28
- --chrome-text: #1a1a1a;
29
- --chrome-text-dim: #64748b;
30
- --chrome-accent: #0d9488;
31
-
32
- --ebook-bg: #ffffff;
33
- --ebook-bg-secondary: #f8fafc;
34
- --ebook-text: #1e293b;
35
- --ebook-text-heading: #0f172a;
36
- --ebook-text-muted: #64748b;
37
- --ebook-border: #e2e8f0;
38
- --ebook-accent: #0d9488;
39
- --ebook-link-color: #0d9488;
40
- --ebook-inline-code-bg: #f1f5f9;
41
- --ebook-inline-code-text: #1e293b;
42
- --ebook-inline-code-border: #e2e8f0;
43
- }
44
-
45
- /* ============================================================
46
- Theme: Sepia
47
- ============================================================ */
48
- .theme-sepia {
49
- --chrome-bg: #faf8f0;
50
- --chrome-bg-glass: rgba(250, 248, 240, 0.85);
51
- --chrome-bg-hover: #f0ead6;
52
- --chrome-border: #d6cdb6;
53
- --chrome-text: #3d3529;
54
- --chrome-text-dim: #7a7060;
55
- --chrome-accent: #b8860b;
56
-
57
- --ebook-bg: #faf8f0;
58
- --ebook-bg-secondary: #f0ead6;
59
- --ebook-text: #3d3529;
60
- --ebook-text-heading: #2d2519;
61
- --ebook-text-muted: #7a7060;
62
- --ebook-border: #d6cdb6;
63
- --ebook-accent: #b8860b;
64
- --ebook-link-color: #b8860b;
65
- --ebook-inline-code-bg: #f0ead6;
66
- --ebook-inline-code-text: #3d3529;
67
- --ebook-inline-code-border: #d6cdb6;
68
- }
69
-
70
- /* ============================================================
71
- Theme: Night
72
- ============================================================ */
73
- .theme-night {
74
- --chrome-bg: #1a1a2e;
75
- --chrome-bg-glass: rgba(26, 26, 46, 0.85);
76
- --chrome-bg-hover: #25253e;
77
- --chrome-border: #333355;
78
- --chrome-text: #e2e8f0;
79
- --chrome-text-dim: #94a3b8;
80
- --chrome-accent: #5eead4;
81
-
82
- --ebook-bg: #1a1a2e;
83
- --ebook-bg-secondary: #25253e;
84
- --ebook-text: #cbd5e1;
85
- --ebook-text-heading: #e2e8f0;
86
- --ebook-text-muted: #94a3b8;
87
- --ebook-border: #333355;
88
- --ebook-accent: #5eead4;
89
- --ebook-link-color: #5eead4;
90
- --ebook-inline-code-bg: #25253e;
91
- --ebook-inline-code-text: #cbd5e1;
92
- --ebook-inline-code-border: #333355;
93
- }
94
-
95
- /* ============================================================
96
- Theme: OLED Black
97
- ============================================================ */
98
- .theme-oled {
99
- --chrome-bg: #000000;
100
- --chrome-bg-glass: rgba(0, 0, 0, 0.85);
101
- --chrome-bg-hover: #1a1a1a;
102
- --chrome-border: #333333;
103
- --chrome-text: #e2e8f0;
104
- --chrome-text-dim: #94a3b8;
105
- --chrome-accent: #5eead4;
106
-
107
- --ebook-bg: #000000;
108
- --ebook-bg-secondary: #1a1a1a;
109
- --ebook-text: #cbd5e1;
110
- --ebook-text-heading: #e2e8f0;
111
- --ebook-text-muted: #94a3b8;
112
- --ebook-border: #333333;
113
- --ebook-accent: #5eead4;
114
- --ebook-link-color: #5eead4;
115
- --ebook-inline-code-bg: #1a1a1a;
116
- --ebook-inline-code-text: #cbd5e1;
117
- --ebook-inline-code-border: #333333;
118
- }
119
-
120
- /* ============================================================
121
- Content Typography
122
- ============================================================ */
123
- .mn-content { position: relative; }
124
-
125
- .mn-content h1 { font-size: 1.875rem; font-weight: 700; margin-bottom: 1rem; color: var(--ebook-text-heading); letter-spacing: -0.01em; padding-bottom: 0.5rem; border-bottom: 1px solid var(--ebook-border); }
126
- .mn-content h2 { font-size: 1.25rem; font-weight: 600; margin-top: 2.5rem; margin-bottom: 0.75rem; color: var(--ebook-text-heading); letter-spacing: -0.005em; }
127
- .mn-content h3 { font-size: 1.125rem; font-weight: 600; margin-top: 1.75rem; margin-bottom: 0.5rem; color: var(--ebook-text-heading); }
128
- .mn-content h4 { font-size: 1rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.4rem; color: var(--ebook-text); }
129
- .mn-content p { margin-bottom: 1.1rem; line-height: var(--ebook-line-height, 1.6); color: var(--ebook-text); font-size: var(--ebook-font-size, 18px); }
130
- .mn-content ul, .mn-content ol { margin-bottom: 1rem; }
131
- .mn-content li { margin-bottom: 0.3rem; line-height: 1.65; }
132
- .mn-content code { font-family: ui-monospace, monospace; font-size: 0.85em; background: var(--ebook-inline-code-bg); padding: 0.15em 0.45em; border-radius: 4px; }
133
- .mn-content a { color: var(--ebook-link-color); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ebook-link-color) 40%, transparent); text-underline-offset: 2px; }
134
- .mn-content a:hover { text-decoration-color: var(--ebook-link-color); }
135
- .mn-content img { max-width: 100%; height: auto; border-radius: 6px; }
136
- .mn-content blockquote { border-left: 3px solid var(--ebook-accent); padding: 0.75rem 1.25rem; margin: 1.5rem 0; font-style: italic; color: var(--ebook-text-muted); }
137
- .mn-content dl { margin: 1rem 0; }
138
- .mn-content dt { font-weight: 600; color: var(--ebook-text-heading); margin-top: 1rem; }
139
- .mn-content dd { margin-left: 1.5rem; margin-bottom: 0.5rem; color: var(--ebook-text); line-height: 1.65; }
140
-
141
- /* Print */
142
- @media print {
143
- .lg\:translate-x-0, #sidebar, .sticky { display: none !important; }
144
- }
145
-
146
- /* Scrollbar */
147
- ::-webkit-scrollbar { width: 8px; height: 8px; }
148
- ::-webkit-scrollbar-track { background: transparent; }
149
- ::-webkit-scrollbar-thumb { background: var(--chrome-border); border-radius: 4px; }
150
- ::-webkit-scrollbar-thumb:hover { background: var(--chrome-text-dim); }
151
-
152
- /* Sidebar layout helpers */
153
- @media (min-width: 1024px) {
154
- .lg\:pl-\[280px\] { padding-left: 280px; }
155
- .lg\:translate-x-0 { --tw-translate-x: 0px; transform: translate(var(--tw-translate-x), var(--tw-translate-y)); }
156
- }