iasp-build 0.1.4__tar.gz

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. iasp_build-0.1.4/LICENSE.md +73 -0
  2. iasp_build-0.1.4/PKG-INFO +91 -0
  3. iasp_build-0.1.4/README.md +73 -0
  4. iasp_build-0.1.4/iasp_build.egg-info/PKG-INFO +91 -0
  5. iasp_build-0.1.4/iasp_build.egg-info/SOURCES.txt +77 -0
  6. iasp_build-0.1.4/iasp_build.egg-info/dependency_links.txt +1 -0
  7. iasp_build-0.1.4/iasp_build.egg-info/entry_points.txt +2 -0
  8. iasp_build-0.1.4/iasp_build.egg-info/requires.txt +7 -0
  9. iasp_build-0.1.4/iasp_build.egg-info/top_level.txt +1 -0
  10. iasp_build-0.1.4/iasp_tooling/__init__.py +66 -0
  11. iasp_build-0.1.4/iasp_tooling/build_book.py +3038 -0
  12. iasp_build-0.1.4/iasp_tooling/cli.py +33 -0
  13. iasp_build-0.1.4/iasp_tooling/latex/box-blockquote.tex +35 -0
  14. iasp_build-0.1.4/iasp_tooling/latex/box-callout.tex +13 -0
  15. iasp_build-0.1.4/iasp_tooling/latex/box-definition.tex +13 -0
  16. iasp_build-0.1.4/iasp_tooling/latex/box-example.tex +13 -0
  17. iasp_build-0.1.4/iasp_tooling/latex/box-note.tex +776 -0
  18. iasp_build-0.1.4/iasp_tooling/latex/box-sidebar-inline.tex +22 -0
  19. iasp_build-0.1.4/iasp_tooling/latex/box-sidebar.tex +76 -0
  20. iasp_build-0.1.4/iasp_tooling/latex/bridgehead.tex +18 -0
  21. iasp_build-0.1.4/iasp_tooling/latex/pdf-header.tex +876 -0
  22. iasp_build-0.1.4/iasp_tooling/latex/sentinel-logging.tex +19 -0
  23. iasp_build-0.1.4/iasp_tooling/lib/__init__.py +1 -0
  24. iasp_build-0.1.4/iasp_tooling/lib/background_palettes.py +55 -0
  25. iasp_build-0.1.4/iasp_tooling/lib/config.py +96 -0
  26. iasp_build-0.1.4/iasp_tooling/lib/container_walker.py +328 -0
  27. iasp_build-0.1.4/iasp_tooling/lib/layout_overrides.py +722 -0
  28. iasp_build-0.1.4/iasp_tooling/lib/order_sources.py +362 -0
  29. iasp_build-0.1.4/iasp_tooling/lib/slot_manager.py +45 -0
  30. iasp_build-0.1.4/iasp_tooling/lib/snapshot_renderer.py +88 -0
  31. iasp_build-0.1.4/iasp_tooling/lib/vscode_tasks.py +257 -0
  32. iasp_build-0.1.4/iasp_tooling/lua/catalog_collections.lua +969 -0
  33. iasp_build-0.1.4/iasp_tooling/lua/chapter_headings.lua +101 -0
  34. iasp_build-0.1.4/iasp_tooling/lua/iasp/include.lua +591 -0
  35. iasp_build-0.1.4/iasp_tooling/lua/iasp/latex.lua +83 -0
  36. iasp_build-0.1.4/iasp_tooling/lua/iasp/metadata.lua +262 -0
  37. iasp_build-0.1.4/iasp_tooling/lua/iasp/profile.lua +146 -0
  38. iasp_build-0.1.4/iasp_tooling/lua/iasp/shorthand.lua +139 -0
  39. iasp_build-0.1.4/iasp_tooling/lua/iasp/table_appearance.lua +405 -0
  40. iasp_build-0.1.4/iasp_tooling/lua/iasp-semantics.lua +1878 -0
  41. iasp_build-0.1.4/iasp_tooling/lua/iasp-toc.lua +186 -0
  42. iasp_build-0.1.4/iasp_tooling/lua/pdf-sidebars.lua +65 -0
  43. iasp_build-0.1.4/iasp_tooling/lua/profile_visibility.lua +16 -0
  44. iasp_build-0.1.4/iasp_tooling/lua/references_running_head.lua +61 -0
  45. iasp_build-0.1.4/iasp_tooling/lua/running_headers.lua +88 -0
  46. iasp_build-0.1.4/iasp_tooling/lua/title_from_first_heading.lua +112 -0
  47. iasp_build-0.1.4/iasp_tooling/lua/titlepage_notice.lua +93 -0
  48. iasp_build-0.1.4/iasp_tooling/paths.py +15 -0
  49. iasp_build-0.1.4/iasp_tooling/preprocess/__init__.py +7 -0
  50. iasp_build-0.1.4/iasp_tooling/preprocess/config.py +99 -0
  51. iasp_build-0.1.4/iasp_tooling/preprocess/expand.py +151 -0
  52. iasp_build-0.1.4/iasp_tooling/preprocess/preview.py +151 -0
  53. iasp_build-0.1.4/iasp_tooling/scripts/__init__.py +1 -0
  54. iasp_build-0.1.4/iasp_tooling/scripts/generate_kdp_cover.py +386 -0
  55. iasp_build-0.1.4/iasp_tooling/scripts/generate_metadata_json.py +77 -0
  56. iasp_build-0.1.4/iasp_tooling/scripts/generate_order_snapshot.py +586 -0
  57. iasp_build-0.1.4/iasp_tooling/scripts/generate_toc.py +2570 -0
  58. iasp_build-0.1.4/iasp_tooling/scripts/ghost_export.py +669 -0
  59. iasp_build-0.1.4/iasp_tooling/scripts/optimize_pdf.py +152 -0
  60. iasp_build-0.1.4/iasp_tooling/scripts/preprocess_expand.py +154 -0
  61. iasp_build-0.1.4/iasp_tooling/scripts/update_ai_turns.py +157 -0
  62. iasp_build-0.1.4/iasp_tooling/styles/styles-epub.css +106 -0
  63. iasp_build-0.1.4/iasp_tooling/styles/styles-shared.css +522 -0
  64. iasp_build-0.1.4/iasp_tooling/styles/styles.css +621 -0
  65. iasp_build-0.1.4/iasp_tooling/tag_by_dir.py +420 -0
  66. iasp_build-0.1.4/iasp_tooling/vocab/iasp.ttl +540 -0
  67. iasp_build-0.1.4/pyproject.toml +31 -0
  68. iasp_build-0.1.4/setup.cfg +4 -0
  69. iasp_build-0.1.4/tests/test_bridge_rendering.py +30 -0
  70. iasp_build-0.1.4/tests/test_build_project_root.py +92 -0
  71. iasp_build-0.1.4/tests/test_generate_order_snapshot_includes.py +96 -0
  72. iasp_build-0.1.4/tests/test_ghost_export.py +307 -0
  73. iasp_build-0.1.4/tests/test_profile_and_titlepage_notice.py +424 -0
  74. iasp_build-0.1.4/tests/test_references_running_head.py +78 -0
  75. iasp_build-0.1.4/tests/test_snapshot_renderer.py +66 -0
  76. iasp_build-0.1.4/tests/test_technical_annex.py +53 -0
  77. iasp_build-0.1.4/tests/test_update_ai_turns.py +15 -0
  78. iasp_build-0.1.4/tests/test_version.py +75 -0
  79. iasp_build-0.1.4/tests/test_vscode_tasks.py +19 -0
@@ -0,0 +1,73 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ ## Acceptance
6
+
7
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
8
+
9
+ ## Copyright License
10
+
11
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
12
+
13
+ ## Distribution License
14
+
15
+ The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
16
+
17
+ ## Notices
18
+
19
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
20
+
21
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
22
+
23
+ ## Changes and New Works License
24
+
25
+ The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
26
+
27
+ ## Patent License
28
+
29
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
30
+
31
+ ## Noncommercial Purposes
32
+
33
+ Any noncommercial purpose is a permitted purpose.
34
+
35
+ ## Personal Uses
36
+
37
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
38
+
39
+ ## Noncommercial Organizations
40
+
41
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
42
+
43
+ ## Fair Use
44
+
45
+ You may have "fair use" rights for the software under the law. These terms do not limit them.
46
+
47
+ ## No Other Rights
48
+
49
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
50
+
51
+ ## Patent Defense
52
+
53
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
54
+
55
+ ## Violations
56
+
57
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
58
+
59
+ ## No Liability
60
+
61
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
62
+
63
+ ## Definitions
64
+
65
+ The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
66
+
67
+ **You** refers to the individual or entity agreeing to these terms.
68
+
69
+ **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
70
+
71
+ **Your licenses** are all the licenses granted to you for the software under these terms.
72
+
73
+ **Use** means anything you do with the software requiring one of your licenses.
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.4
2
+ Name: iasp-build
3
+ Version: 0.1.4
4
+ Summary: Pandoc-based build tools for manuscripts using the Informative Authoring Semantics Profile
5
+ License-Expression: PolyForm-Noncommercial-1.0.0
6
+ Project-URL: Homepage, https://github.com/jmajerus/iasp-build
7
+ Project-URL: Documentation, https://github.com/jmajerus/iasp-build/tree/main/docs
8
+ Project-URL: Changelog, https://github.com/jmajerus/iasp-build/releases
9
+ Requires-Python: >=3.10
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE.md
12
+ Requires-Dist: PyYAML>=6
13
+ Provides-Extra: kdp
14
+ Requires-Dist: Pillow>=9; extra == "kdp"
15
+ Provides-Extra: test
16
+ Requires-Dist: pytest>=7; extra == "test"
17
+ Dynamic: license-file
18
+
19
+ # IASP Build
20
+
21
+ IASP Build uses Pandoc to build Markdown manuscripts with the Informative Authoring Semantics Profile. It includes the Lua filters, LaTeX templates, stylesheets, and vocabulary used by the manuscript builder.
22
+
23
+ ## Choose a tool
24
+
25
+ | Your aim | Tool |
26
+ | --- | --- |
27
+ | Build a manuscript from a repository with an ordered set of chapters, annexes, and named output profiles | **iasp-build**, a Python CLI for local builds and build automation |
28
+ | Give an MCP client authoring guidance, validate IASP markup, check quotations, or render a draft for review | **iasp-mcp**, an authoring server with a web interface and quote and bibliography integrations. [iasp-mcp repository](https://github.com/jmajerus/iasp-mcp) |
29
+
30
+ Both tools use IASP markup and can render documents.
31
+
32
+ ## Use both for a book
33
+
34
+ Install `iasp-build` in the manuscript’s Python environment and connect your authoring client to `iasp-mcp`. Keep the Markdown sources and build configuration in the manuscript repository. [Set up iasp-mcp](https://github.com/jmajerus/iasp-mcp#quick-start)
35
+
36
+ 1. **Draft and review a chapter.** Ask `iasp-mcp` for help choosing IASP markup, then run `validate_markdown` to catch markup problems and check marked quotations when the quote service is configured. Use `render_document` for a draft preview. Pass Markdown directly for a self-contained draft. For chapters with includes, give the server access to the chapter and its included files.
37
+ 2. **Carry the sources into the book.** Apply accepted edits to the chapter’s source Markdown. Use the same citation keys in the draft and the manuscript’s `references.bib`. A preview can look up missing bibliography entries through the configured library integrations, so make sure those entries are in the book’s bibliography before the full build.
38
+ 3. **Assemble the manuscript.** Add the chapter to `book-order.txt` or the order file for its annex. Run a manuscript build with `iasp-build`, such as `iasp-build epub` for the book or `iasp-build --profile annex1 pdf-screen` for a named annex. Review that output for issues that only show up when chapters are assembled, such as cross-references and pagination.
39
+
40
+ See the [iasp-mcp tool reference](https://github.com/jmajerus/iasp-mcp/blob/main/docs/tools.md) for validation and render options.
41
+
42
+ ## Install
43
+
44
+ Releases are published on [PyPI](https://pypi.org/project/iasp-build/). A manuscript lists the release series it is written for in its `requirements-build.txt`:
45
+
46
+ ```text
47
+ iasp-build[kdp]~=0.1.4
48
+ ```
49
+
50
+ `~=0.1.4` accepts 0.1.4 and any later 0.1.x release. Install or upgrade the virtual environment used by your manuscript with `python3 -m pip install -U -r requirements-build.txt`. New releases then reach the manuscript without a commit to its repository. To try unreleased changes, install from a checkout instead: `python3 -m pip install -e '/path/to/iasp-build'`.
51
+
52
+ The `kdp` extra adds Pillow for cover generation. Install Pandoc separately. PDF builds require XeLaTeX and its LaTeX packages. The builder can also use EPUBCheck for EPUB validation and qpdf for PDF optimization.
53
+
54
+ From a manuscript directory:
55
+
56
+ ```sh
57
+ iasp-build epub
58
+ iasp-build --profile annex1 pdf-screen
59
+ iasp-build article-md articles/example.md
60
+ ```
61
+
62
+ From elsewhere, pass `--project-root /path/to/manuscript`. A minimal manuscript needs `metadata.yaml`, `book-order.txt` listing its Markdown files, and `iasp-config.yaml` with `toc.enabled: false` if it has no generated table of contents. Named profiles in `build-profiles.json` can select an order file, additional metadata, cover artwork, and an output basename. Outputs go into the manuscript’s `build/` directory. Each build prints the iasp-build version it ran with and records it as `iasp-build-version` in `build/build-metadata.json`; `iasp-build --version` shows it too. When running from a checkout, the version includes the commit, such as `0.1.4+g1a2b3c4`, with `.dirty` added for uncommitted changes.
63
+
64
+ See the [pipeline guide](docs/Build%20Pipeline.md) and [semantic vocabulary](docs/Semantic%20Vocabulary.md) for details. Some examples use files from the original manuscript checkout.
65
+
66
+ ## Build the technical annex
67
+
68
+ The IASP Framework Technical Annex bundles the version of the documentation
69
+ in this checkout. From the repository root with `iasp-build` installed, run:
70
+
71
+ ```sh
72
+ iasp-build --project-root docs --profile iasp-framework epub
73
+ iasp-build --project-root docs --profile iasp-framework pdf-screen
74
+ ```
75
+
76
+ Use the same command with `docx` for a Word edition. The files are written
77
+ to `docs/build/annexes/`.
78
+
79
+ ## Tests
80
+
81
+ To run the tests, install the `test` extra and run `python3 -m pytest`. The detached-manuscript integration test uses Pandoc.
82
+
83
+ CI runs the tests on every pull request and on each push to `main`.
84
+
85
+ ## Releasing
86
+
87
+ Releases are published by the [Release workflow](.github/workflows/release.yml). To cut one, go to **Actions → Release → Run workflow** and choose `patch`, `minor` or `major`. The workflow bumps the version in `pyproject.toml`, runs the tests, commits `Release X.Y.Z` to `main`, uploads the wheel and sdist to PyPI, and publishes a GitHub Release tagged `vX.Y.Z` with the same files. If you bump the version yourself in a pull request, merging it to `main` starts the same release.
88
+
89
+ While the version is `0.x`, use `patch` for fixes and features that existing manuscripts can build with unchanged, and `minor` for changes that need manuscripts to be updated. Manuscripts that pin `~=0.1.4` pick up patch releases automatically and need an edit to move to `0.2`.
90
+
91
+ PyPI uploads use [trusted publishing](https://docs.pypi.org/trusted-publishers/), so the repository stores no PyPI token. The trusted publisher on PyPI names this repository, the `release.yml` workflow and the `pypi` environment.
@@ -0,0 +1,73 @@
1
+ # IASP Build
2
+
3
+ IASP Build uses Pandoc to build Markdown manuscripts with the Informative Authoring Semantics Profile. It includes the Lua filters, LaTeX templates, stylesheets, and vocabulary used by the manuscript builder.
4
+
5
+ ## Choose a tool
6
+
7
+ | Your aim | Tool |
8
+ | --- | --- |
9
+ | Build a manuscript from a repository with an ordered set of chapters, annexes, and named output profiles | **iasp-build**, a Python CLI for local builds and build automation |
10
+ | Give an MCP client authoring guidance, validate IASP markup, check quotations, or render a draft for review | **iasp-mcp**, an authoring server with a web interface and quote and bibliography integrations. [iasp-mcp repository](https://github.com/jmajerus/iasp-mcp) |
11
+
12
+ Both tools use IASP markup and can render documents.
13
+
14
+ ## Use both for a book
15
+
16
+ Install `iasp-build` in the manuscript’s Python environment and connect your authoring client to `iasp-mcp`. Keep the Markdown sources and build configuration in the manuscript repository. [Set up iasp-mcp](https://github.com/jmajerus/iasp-mcp#quick-start)
17
+
18
+ 1. **Draft and review a chapter.** Ask `iasp-mcp` for help choosing IASP markup, then run `validate_markdown` to catch markup problems and check marked quotations when the quote service is configured. Use `render_document` for a draft preview. Pass Markdown directly for a self-contained draft. For chapters with includes, give the server access to the chapter and its included files.
19
+ 2. **Carry the sources into the book.** Apply accepted edits to the chapter’s source Markdown. Use the same citation keys in the draft and the manuscript’s `references.bib`. A preview can look up missing bibliography entries through the configured library integrations, so make sure those entries are in the book’s bibliography before the full build.
20
+ 3. **Assemble the manuscript.** Add the chapter to `book-order.txt` or the order file for its annex. Run a manuscript build with `iasp-build`, such as `iasp-build epub` for the book or `iasp-build --profile annex1 pdf-screen` for a named annex. Review that output for issues that only show up when chapters are assembled, such as cross-references and pagination.
21
+
22
+ See the [iasp-mcp tool reference](https://github.com/jmajerus/iasp-mcp/blob/main/docs/tools.md) for validation and render options.
23
+
24
+ ## Install
25
+
26
+ Releases are published on [PyPI](https://pypi.org/project/iasp-build/). A manuscript lists the release series it is written for in its `requirements-build.txt`:
27
+
28
+ ```text
29
+ iasp-build[kdp]~=0.1.4
30
+ ```
31
+
32
+ `~=0.1.4` accepts 0.1.4 and any later 0.1.x release. Install or upgrade the virtual environment used by your manuscript with `python3 -m pip install -U -r requirements-build.txt`. New releases then reach the manuscript without a commit to its repository. To try unreleased changes, install from a checkout instead: `python3 -m pip install -e '/path/to/iasp-build'`.
33
+
34
+ The `kdp` extra adds Pillow for cover generation. Install Pandoc separately. PDF builds require XeLaTeX and its LaTeX packages. The builder can also use EPUBCheck for EPUB validation and qpdf for PDF optimization.
35
+
36
+ From a manuscript directory:
37
+
38
+ ```sh
39
+ iasp-build epub
40
+ iasp-build --profile annex1 pdf-screen
41
+ iasp-build article-md articles/example.md
42
+ ```
43
+
44
+ From elsewhere, pass `--project-root /path/to/manuscript`. A minimal manuscript needs `metadata.yaml`, `book-order.txt` listing its Markdown files, and `iasp-config.yaml` with `toc.enabled: false` if it has no generated table of contents. Named profiles in `build-profiles.json` can select an order file, additional metadata, cover artwork, and an output basename. Outputs go into the manuscript’s `build/` directory. Each build prints the iasp-build version it ran with and records it as `iasp-build-version` in `build/build-metadata.json`; `iasp-build --version` shows it too. When running from a checkout, the version includes the commit, such as `0.1.4+g1a2b3c4`, with `.dirty` added for uncommitted changes.
45
+
46
+ See the [pipeline guide](docs/Build%20Pipeline.md) and [semantic vocabulary](docs/Semantic%20Vocabulary.md) for details. Some examples use files from the original manuscript checkout.
47
+
48
+ ## Build the technical annex
49
+
50
+ The IASP Framework Technical Annex bundles the version of the documentation
51
+ in this checkout. From the repository root with `iasp-build` installed, run:
52
+
53
+ ```sh
54
+ iasp-build --project-root docs --profile iasp-framework epub
55
+ iasp-build --project-root docs --profile iasp-framework pdf-screen
56
+ ```
57
+
58
+ Use the same command with `docx` for a Word edition. The files are written
59
+ to `docs/build/annexes/`.
60
+
61
+ ## Tests
62
+
63
+ To run the tests, install the `test` extra and run `python3 -m pytest`. The detached-manuscript integration test uses Pandoc.
64
+
65
+ CI runs the tests on every pull request and on each push to `main`.
66
+
67
+ ## Releasing
68
+
69
+ Releases are published by the [Release workflow](.github/workflows/release.yml). To cut one, go to **Actions → Release → Run workflow** and choose `patch`, `minor` or `major`. The workflow bumps the version in `pyproject.toml`, runs the tests, commits `Release X.Y.Z` to `main`, uploads the wheel and sdist to PyPI, and publishes a GitHub Release tagged `vX.Y.Z` with the same files. If you bump the version yourself in a pull request, merging it to `main` starts the same release.
70
+
71
+ While the version is `0.x`, use `patch` for fixes and features that existing manuscripts can build with unchanged, and `minor` for changes that need manuscripts to be updated. Manuscripts that pin `~=0.1.4` pick up patch releases automatically and need an edit to move to `0.2`.
72
+
73
+ PyPI uploads use [trusted publishing](https://docs.pypi.org/trusted-publishers/), so the repository stores no PyPI token. The trusted publisher on PyPI names this repository, the `release.yml` workflow and the `pypi` environment.
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.4
2
+ Name: iasp-build
3
+ Version: 0.1.4
4
+ Summary: Pandoc-based build tools for manuscripts using the Informative Authoring Semantics Profile
5
+ License-Expression: PolyForm-Noncommercial-1.0.0
6
+ Project-URL: Homepage, https://github.com/jmajerus/iasp-build
7
+ Project-URL: Documentation, https://github.com/jmajerus/iasp-build/tree/main/docs
8
+ Project-URL: Changelog, https://github.com/jmajerus/iasp-build/releases
9
+ Requires-Python: >=3.10
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE.md
12
+ Requires-Dist: PyYAML>=6
13
+ Provides-Extra: kdp
14
+ Requires-Dist: Pillow>=9; extra == "kdp"
15
+ Provides-Extra: test
16
+ Requires-Dist: pytest>=7; extra == "test"
17
+ Dynamic: license-file
18
+
19
+ # IASP Build
20
+
21
+ IASP Build uses Pandoc to build Markdown manuscripts with the Informative Authoring Semantics Profile. It includes the Lua filters, LaTeX templates, stylesheets, and vocabulary used by the manuscript builder.
22
+
23
+ ## Choose a tool
24
+
25
+ | Your aim | Tool |
26
+ | --- | --- |
27
+ | Build a manuscript from a repository with an ordered set of chapters, annexes, and named output profiles | **iasp-build**, a Python CLI for local builds and build automation |
28
+ | Give an MCP client authoring guidance, validate IASP markup, check quotations, or render a draft for review | **iasp-mcp**, an authoring server with a web interface and quote and bibliography integrations. [iasp-mcp repository](https://github.com/jmajerus/iasp-mcp) |
29
+
30
+ Both tools use IASP markup and can render documents.
31
+
32
+ ## Use both for a book
33
+
34
+ Install `iasp-build` in the manuscript’s Python environment and connect your authoring client to `iasp-mcp`. Keep the Markdown sources and build configuration in the manuscript repository. [Set up iasp-mcp](https://github.com/jmajerus/iasp-mcp#quick-start)
35
+
36
+ 1. **Draft and review a chapter.** Ask `iasp-mcp` for help choosing IASP markup, then run `validate_markdown` to catch markup problems and check marked quotations when the quote service is configured. Use `render_document` for a draft preview. Pass Markdown directly for a self-contained draft. For chapters with includes, give the server access to the chapter and its included files.
37
+ 2. **Carry the sources into the book.** Apply accepted edits to the chapter’s source Markdown. Use the same citation keys in the draft and the manuscript’s `references.bib`. A preview can look up missing bibliography entries through the configured library integrations, so make sure those entries are in the book’s bibliography before the full build.
38
+ 3. **Assemble the manuscript.** Add the chapter to `book-order.txt` or the order file for its annex. Run a manuscript build with `iasp-build`, such as `iasp-build epub` for the book or `iasp-build --profile annex1 pdf-screen` for a named annex. Review that output for issues that only show up when chapters are assembled, such as cross-references and pagination.
39
+
40
+ See the [iasp-mcp tool reference](https://github.com/jmajerus/iasp-mcp/blob/main/docs/tools.md) for validation and render options.
41
+
42
+ ## Install
43
+
44
+ Releases are published on [PyPI](https://pypi.org/project/iasp-build/). A manuscript lists the release series it is written for in its `requirements-build.txt`:
45
+
46
+ ```text
47
+ iasp-build[kdp]~=0.1.4
48
+ ```
49
+
50
+ `~=0.1.4` accepts 0.1.4 and any later 0.1.x release. Install or upgrade the virtual environment used by your manuscript with `python3 -m pip install -U -r requirements-build.txt`. New releases then reach the manuscript without a commit to its repository. To try unreleased changes, install from a checkout instead: `python3 -m pip install -e '/path/to/iasp-build'`.
51
+
52
+ The `kdp` extra adds Pillow for cover generation. Install Pandoc separately. PDF builds require XeLaTeX and its LaTeX packages. The builder can also use EPUBCheck for EPUB validation and qpdf for PDF optimization.
53
+
54
+ From a manuscript directory:
55
+
56
+ ```sh
57
+ iasp-build epub
58
+ iasp-build --profile annex1 pdf-screen
59
+ iasp-build article-md articles/example.md
60
+ ```
61
+
62
+ From elsewhere, pass `--project-root /path/to/manuscript`. A minimal manuscript needs `metadata.yaml`, `book-order.txt` listing its Markdown files, and `iasp-config.yaml` with `toc.enabled: false` if it has no generated table of contents. Named profiles in `build-profiles.json` can select an order file, additional metadata, cover artwork, and an output basename. Outputs go into the manuscript’s `build/` directory. Each build prints the iasp-build version it ran with and records it as `iasp-build-version` in `build/build-metadata.json`; `iasp-build --version` shows it too. When running from a checkout, the version includes the commit, such as `0.1.4+g1a2b3c4`, with `.dirty` added for uncommitted changes.
63
+
64
+ See the [pipeline guide](docs/Build%20Pipeline.md) and [semantic vocabulary](docs/Semantic%20Vocabulary.md) for details. Some examples use files from the original manuscript checkout.
65
+
66
+ ## Build the technical annex
67
+
68
+ The IASP Framework Technical Annex bundles the version of the documentation
69
+ in this checkout. From the repository root with `iasp-build` installed, run:
70
+
71
+ ```sh
72
+ iasp-build --project-root docs --profile iasp-framework epub
73
+ iasp-build --project-root docs --profile iasp-framework pdf-screen
74
+ ```
75
+
76
+ Use the same command with `docx` for a Word edition. The files are written
77
+ to `docs/build/annexes/`.
78
+
79
+ ## Tests
80
+
81
+ To run the tests, install the `test` extra and run `python3 -m pytest`. The detached-manuscript integration test uses Pandoc.
82
+
83
+ CI runs the tests on every pull request and on each push to `main`.
84
+
85
+ ## Releasing
86
+
87
+ Releases are published by the [Release workflow](.github/workflows/release.yml). To cut one, go to **Actions → Release → Run workflow** and choose `patch`, `minor` or `major`. The workflow bumps the version in `pyproject.toml`, runs the tests, commits `Release X.Y.Z` to `main`, uploads the wheel and sdist to PyPI, and publishes a GitHub Release tagged `vX.Y.Z` with the same files. If you bump the version yourself in a pull request, merging it to `main` starts the same release.
88
+
89
+ While the version is `0.x`, use `patch` for fixes and features that existing manuscripts can build with unchanged, and `minor` for changes that need manuscripts to be updated. Manuscripts that pin `~=0.1.4` pick up patch releases automatically and need an edit to move to `0.2`.
90
+
91
+ PyPI uploads use [trusted publishing](https://docs.pypi.org/trusted-publishers/), so the repository stores no PyPI token. The trusted publisher on PyPI names this repository, the `release.yml` workflow and the `pypi` environment.
@@ -0,0 +1,77 @@
1
+ LICENSE.md
2
+ README.md
3
+ pyproject.toml
4
+ iasp_build.egg-info/PKG-INFO
5
+ iasp_build.egg-info/SOURCES.txt
6
+ iasp_build.egg-info/dependency_links.txt
7
+ iasp_build.egg-info/entry_points.txt
8
+ iasp_build.egg-info/requires.txt
9
+ iasp_build.egg-info/top_level.txt
10
+ iasp_tooling/__init__.py
11
+ iasp_tooling/build_book.py
12
+ iasp_tooling/cli.py
13
+ iasp_tooling/paths.py
14
+ iasp_tooling/tag_by_dir.py
15
+ iasp_tooling/latex/box-blockquote.tex
16
+ iasp_tooling/latex/box-callout.tex
17
+ iasp_tooling/latex/box-definition.tex
18
+ iasp_tooling/latex/box-example.tex
19
+ iasp_tooling/latex/box-note.tex
20
+ iasp_tooling/latex/box-sidebar-inline.tex
21
+ iasp_tooling/latex/box-sidebar.tex
22
+ iasp_tooling/latex/bridgehead.tex
23
+ iasp_tooling/latex/pdf-header.tex
24
+ iasp_tooling/latex/sentinel-logging.tex
25
+ iasp_tooling/lib/__init__.py
26
+ iasp_tooling/lib/background_palettes.py
27
+ iasp_tooling/lib/config.py
28
+ iasp_tooling/lib/container_walker.py
29
+ iasp_tooling/lib/layout_overrides.py
30
+ iasp_tooling/lib/order_sources.py
31
+ iasp_tooling/lib/slot_manager.py
32
+ iasp_tooling/lib/snapshot_renderer.py
33
+ iasp_tooling/lib/vscode_tasks.py
34
+ iasp_tooling/lua/catalog_collections.lua
35
+ iasp_tooling/lua/chapter_headings.lua
36
+ iasp_tooling/lua/iasp-semantics.lua
37
+ iasp_tooling/lua/iasp-toc.lua
38
+ iasp_tooling/lua/pdf-sidebars.lua
39
+ iasp_tooling/lua/profile_visibility.lua
40
+ iasp_tooling/lua/references_running_head.lua
41
+ iasp_tooling/lua/running_headers.lua
42
+ iasp_tooling/lua/title_from_first_heading.lua
43
+ iasp_tooling/lua/titlepage_notice.lua
44
+ iasp_tooling/lua/iasp/include.lua
45
+ iasp_tooling/lua/iasp/latex.lua
46
+ iasp_tooling/lua/iasp/metadata.lua
47
+ iasp_tooling/lua/iasp/profile.lua
48
+ iasp_tooling/lua/iasp/shorthand.lua
49
+ iasp_tooling/lua/iasp/table_appearance.lua
50
+ iasp_tooling/preprocess/__init__.py
51
+ iasp_tooling/preprocess/config.py
52
+ iasp_tooling/preprocess/expand.py
53
+ iasp_tooling/preprocess/preview.py
54
+ iasp_tooling/scripts/__init__.py
55
+ iasp_tooling/scripts/generate_kdp_cover.py
56
+ iasp_tooling/scripts/generate_metadata_json.py
57
+ iasp_tooling/scripts/generate_order_snapshot.py
58
+ iasp_tooling/scripts/generate_toc.py
59
+ iasp_tooling/scripts/ghost_export.py
60
+ iasp_tooling/scripts/optimize_pdf.py
61
+ iasp_tooling/scripts/preprocess_expand.py
62
+ iasp_tooling/scripts/update_ai_turns.py
63
+ iasp_tooling/styles/styles-epub.css
64
+ iasp_tooling/styles/styles-shared.css
65
+ iasp_tooling/styles/styles.css
66
+ iasp_tooling/vocab/iasp.ttl
67
+ tests/test_bridge_rendering.py
68
+ tests/test_build_project_root.py
69
+ tests/test_generate_order_snapshot_includes.py
70
+ tests/test_ghost_export.py
71
+ tests/test_profile_and_titlepage_notice.py
72
+ tests/test_references_running_head.py
73
+ tests/test_snapshot_renderer.py
74
+ tests/test_technical_annex.py
75
+ tests/test_update_ai_turns.py
76
+ tests/test_version.py
77
+ tests/test_vscode_tasks.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ iasp-build = iasp_tooling.cli:main
@@ -0,0 +1,7 @@
1
+ PyYAML>=6
2
+
3
+ [kdp]
4
+ Pillow>=9
5
+
6
+ [test]
7
+ pytest>=7
@@ -0,0 +1 @@
1
+ iasp_tooling
@@ -0,0 +1,66 @@
1
+ """Reusable IASP tooling package for build orchestration."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import re
6
+ import subprocess
7
+ from importlib import metadata
8
+ from pathlib import Path
9
+
10
+ _PACKAGE_DIR = Path(__file__).resolve().parent
11
+
12
+
13
+ def _checkout_version() -> str | None:
14
+ """Read the version from pyproject.toml when running from a checkout."""
15
+
16
+ pyproject = _PACKAGE_DIR.parent / "pyproject.toml"
17
+ try:
18
+ text = pyproject.read_text(encoding="utf-8")
19
+ except OSError:
20
+ return None
21
+ # tomllib is not available on Python 3.10, and the version line is simple.
22
+ match = re.search(r'^version\s*=\s*"([^"]+)"', text, re.M)
23
+ return match.group(1) if match else None
24
+
25
+
26
+ def _git_suffix() -> str:
27
+ """Local version label for code running from a git checkout.
28
+
29
+ An installed wheel has no .git next to it, so released builds report the
30
+ plain version. A checkout (editable install or PYTHONPATH) reports the
31
+ commit, plus ".dirty" when it has uncommitted changes or new files that
32
+ are not ignored.
33
+ """
34
+
35
+ checkout = _PACKAGE_DIR.parent
36
+ if not (checkout / ".git").exists():
37
+ return ""
38
+ try:
39
+ commit = subprocess.run(
40
+ ["git", "-C", str(checkout), "rev-parse", "--short", "HEAD"],
41
+ capture_output=True, text=True, check=True, timeout=5,
42
+ ).stdout.strip()
43
+ dirty = subprocess.run(
44
+ ["git", "-C", str(checkout), "status", "--porcelain"],
45
+ capture_output=True, text=True, check=True, timeout=5,
46
+ ).stdout.strip()
47
+ except (OSError, subprocess.SubprocessError):
48
+ return ""
49
+ if not commit:
50
+ return ""
51
+ return f"+g{commit}" + (".dirty" if dirty else "")
52
+
53
+
54
+ def _version() -> str:
55
+ # A checkout's pyproject.toml is newer than the metadata an editable
56
+ # install recorded, so prefer it.
57
+ base = _checkout_version()
58
+ if base is None:
59
+ try:
60
+ base = metadata.version("iasp-build")
61
+ except metadata.PackageNotFoundError:
62
+ base = "0+unknown"
63
+ return base + _git_suffix()
64
+
65
+
66
+ __version__ = _version()