Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: redhat-documentation/newdoc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.6.3
Choose a base ref
...
head repository: redhat-documentation/newdoc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 4,029 additions and 971 deletions.
  1. +7 −4 .copr/Makefile
  2. +49 −0 .github/workflows/pages.yml
  3. +20 −0 .github/workflows/rust-test.yml
  4. +3 −0 .gitignore
  5. +0 −32 .rpm/newdoc.spec
  6. +0 −32 .travis.yml
  7. +232 −0 CHANGELOG.md
  8. +4 −0 CONTRIBUTING.md
  9. +882 −74 Cargo.lock
  10. +24 −13 Cargo.toml
  11. +14 −0 DCO.md
  12. +12 −15 Dockerfile
  13. +17 −0 Dockerfile-distro
  14. +153 −0 PACKAGING.md
  15. +7 −180 README.md
  16. +0 −86 appveyor.yml
  17. +49 −0 build.rs
  18. +31 −0 docs/assembly_generating-documentation-files.adoc
  19. +36 −0 docs/con_configuration-files.adoc
  20. +28 −0 docs/proc_creating-a-new-assembly.adoc
  21. +20 −0 docs/proc_creating-a-new-module.adoc
  22. +24 −0 docs/proc_creating-a-new-snippet-file.adoc
  23. +133 −0 docs/proc_installing-newdoc.adoc
  24. +13 −0 docs/proc_overwriting-existing-files.adoc
  25. +80 −0 docs/proc_updating-newdoc.adoc
  26. +33 −0 docs/ref_options.adoc
  27. +23 −0 docs/using-newdoc.adoc
  28. +60 −0 newdoc.spec
  29. +203 −102 src/cmd_line.rs
  30. +241 −0 src/config.rs
  31. +128 −0 src/lib.rs
  32. +56 −0 src/logging.rs
  33. +28 −96 src/main.rs
  34. +216 −172 src/module.rs
  35. +238 −0 src/templating.rs
  36. +50 −43 src/write.rs
  37. +52 −0 templates/README.md
  38. +55 −37 templates/assembly.adoc
  39. +47 −26 templates/concept.adoc
  40. +76 −43 templates/procedure.adoc
  41. +38 −16 templates/reference.adoc
  42. +50 −0 templates/snippet.adoc
  43. +4 −0 tests/generated/README.md
  44. +86 −0 tests/generated/assembly_testing-that-an-assembly-forms-properly.adoc
  45. +58 −0 tests/generated/con_a-title-that-tests-a-concept.adoc
  46. +12 −0 tests/generated/minimal-assembly.adoc
  47. +7 −0 tests/generated/minimal-concept.adoc
  48. +17 −0 tests/generated/minimal-procedure.adoc
  49. +7 −0 tests/generated/minimal-reference.adoc
  50. +4 −0 tests/generated/minimal-snippet.adoc
  51. +86 −0 tests/generated/proc_testing-a-procedure.adoc
  52. +59 −0 tests/generated/ref_the-lines-in-a-reference-module.adoc
  53. +45 −0 tests/generated/snip_some-notes-in-a-snippet-file.adoc
  54. +212 −0 tests/integration.rs
11 changes: 7 additions & 4 deletions .copr/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
srpm:
dnf -y install cargo
cargo install cargo-rpm
cargo rpm build
mv target/release/rpmbuild/SRPMS/* $(outdir)
dnf install -y rpmdevtools cargo
rpmdev-setuptree
cargo package
mv target/package/*.crate ~/rpmbuild/SOURCES/
cp newdoc.spec ~/rpmbuild/SPECS/
rpmbuild -bs ~/rpmbuild/SPECS/newdoc.spec
cp ~/rpmbuild/SRPMS/newdoc-*.src.rpm $(outdir)
49 changes: 49 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Deploy AsciiDoc documentation to GitHub Pages
name: Deploy documentation to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Build and publish the documentation
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
container: asciidoctor/docker-asciidoctor
steps:
- name: Checkout
uses: actions/checkout@v4
# The asciidoctor container is built on Alpine and contains only a Busybox tar.
# Github Actions need GNU tar for its options.
- name: Install tar
run: apk add tar
- name: Build documentation
run: asciidoctor --safe -vn docs/using-newdoc.adoc --out-file=docs/index.html
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload the generated HTML file
path: 'docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
20 changes: 20 additions & 0 deletions .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Rust tests

on: [ push ]

env:
CARGO_TERM_COLOR: always

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Check syntax
run: cargo check
- name: Run tests
run: cargo test
- name: Check lints
run: cargo clippy
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/target
/*.adoc
newdoc.1
.vscode
32 changes: 0 additions & 32 deletions .rpm/newdoc.spec

This file was deleted.

32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

232 changes: 232 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
# Changelog

The following is a summary of changes in each `newdoc` release, which is also a Git tag by the same name in this repository.

## v2.18.4

* Update modular templates to synchronize with [modular-docs/pull/236](https://github.com/redhat-documentation/modular-docs/pull/236)
* Update dependencies

## v2.18.3

* Update dependencies

## v2.18.2

* Previously, newdoc didn't recognize configuration files in your Git repository when you entered its sub-directories. This is now fixed, and newdoc can detect configuration files even from sub-directories. See [RHELDOCS-17915](https://issues.redhat.com/browse/RHELDOCS-17915).

## v2.18.1

* Fix the `--no-file-prefixes` (`-P`) option. Previously, the option didn't have the expected effect, and instead, it disabled comments.

## v2.18.0

* An option to generate files without the metadata attributes header. See [issue #45](https://github.com/redhat-documentation/newdoc/issues/45).

## v2.17.0

* Enable configuration files. [See the documentation](https://redhat-documentation.github.io/newdoc/#_configuration_files). [Issue #20](https://github.com/redhat-documentation/newdoc/issues/20)
* Remove the outdated `abstract` tag from all templates. [Issue #40](https://github.com/redhat-documentation/newdoc/issues/40)
* Update various dependencies.

## v2.16.0

* Enable the `--simplified` option to generate files without the `context` attribute. See [issue #31](https://github.com/redhat-documentation/newdoc/issues/31).
* Update various dependencies.

## v2.15.1

* Properly follow the `YYYY-MM-DD` date format. Fixes [issue #39](https://github.com/redhat-documentation/newdoc/issues/39).
* Update various dependencies.

## v2.15.0

* Add metadata in the generated files that specify which newdoc version generated the document and the date that it was generated.
* Build the RPM using rustup to work around the outdated toolchain on RHEL.

## v2.14.1

* Rename `_content-type` to `_mod-docs-content-type`. See [issue #37](https://github.com/redhat-documentation/newdoc/issues/37).

## v2.14.0

* Update modular templates to synchronize with [modular-docs/pull/208](https://github.com/redhat-documentation/modular-docs/pull/208/).
* Remove the legacy, deprecated `--validate` (`-l`) option. Please use Enki instead: <https://github.com/Levi-Leah/enki/>.
* The command-line options parser previously disabled snippets by mistake. Fix and re-enable them.
* Switch the main container to the Alpine base from UBI Micro.
* Update various dependencies.

## v2.13.1

* The help message and the man page now specify that the validation feature is deprecated. See [#36](https://github.com/redhat-documentation/newdoc/issues/36).

## v2.13.0

* By default, the generated files do not contain any comments. The `--no-comments` (`-C`) option is now deprecated and has no effect. You can use the new `--comments` (`-M`) option to generate files with the comments that were previously the default.

## v2.12.0

* Deprecate the `--validate` (`-l`) option. Please use `enki` instead: <https://github.com/Levi-Leah/enki/>.
* Switch to the `bpaf` command-line argument parser.

## v2.11.0

* Separate options for the module type prefix in IDs (anchors) and file names.

## v2.10.6

* A prettier confirmation prompt when overwriting a file.

## v2.10.5

* Update the modular templates to the latest upstream version.

## v2.10.4

* Improvements to error handling and reporting.

## v2.10.3

* Validation: Jupiter now supports attributes in titles.
* Remove the `--detect-directory` option, which has been the default behavior.
* Minor internal changes.

## v2.10.2

* Sanitize non-ASCII characters in the module ID ([#33](https://github.com/redhat-documentation/newdoc/issues/33)).
* No longer check for the `experimental` attribute, which isn't required anymore.

## v2.10.1

* Fix an ID bug reported by Marc Muehlfeld.

## v2.10.0

* Enable generating the snippet file type.

## v2.9.8

* Remove the abstract tag from the templates. Jupiter doesn't require it.
* No longer report a missing abstract tag in validation

## v2.9.7

* The `--validate` option can take multiple values.

## v2.9.6

* No longer validate that xrefs are path-based; Jupiter does not require them
* Changes to error handling

## v2.9.5

* Check that each module name is a single string
* Various internal improvements and documentation fixes

## v2.9.4

* Rename the `:_module-type:` attribute to `:_content-type:`

## v2.9.3

* Validation: Report when no issues have been found.
* Improve the documentation in the readme.

## v2.9.2

* Validation: Use a slightly more robust detection of path-based xrefs.

## v2.9.1

* Validation: Check that supported xrefs are path-based.

## v2.9.0

* Add a validation (linting) functionality using the `--validate` option.

## v2.8.3

* Update the modular templates to match upstream changes

## v2.8.2

* Add the module type attributes; Issue #18
* Remove the blank line after 'Additional resources' in the assembly, which caused issues with Pantheon 2

## v2.8.1

* Update the modular templates to match upstream changes

## v2.8.0

* Use a standardized syntax for configuring the templates (askama).
* Remove extra blank lines from the generated files.

## v2.7.0

* Attempt to fill in the full include path by default. This obsoletes the `--detect-directory` option. Issue #16
* Use a more standardizedterminal logging solution. You can now set the verbosity level.

## v2.6.4

* Update the modular templates.

## v2.6.3

* Update the crates that newdoc depends on.

## v2.6.2

* Bug fix: With the --no-comments option, remove all multi-line comments, not just the first one

## v2.6.1

* Change the assembly prerequisites to a numbered heading in accordance with modular-docs #134
* Small internal changes

## v2.6.0

* The templates have been updated with Patheon 2 metadata
* The generated IDs now start with a module type prefix, matching the new templates

## v2.5.0

* Add the `--no-examples` option
* Recognize block AsciiDoc comments in the templates
* Add first unit tests

## v2.4.0

* Optionally detect and fill out the include path
* Refactoring the code into smaller modules

## v2.3.5

* Deduplicate app metadata

## v2.3.4

* Updated README
* New packaging options
* Enabled CI

## v2.3.3

* Make context in assembly IDs optional and conditional

## v2.3.2

* Align the Optional formatting with the IBM Style Guide; #8

## v2.3.1

* Use colors instead of emoji for highlighting in the output

## v2.3.0 and earlier

No changelog. See the commit messages between the Git tags.

## v2.0.0

Initial release of `newdoc` rewritten in the Rust language.

4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Certificate of Origin

By contributing to this project you agree to the Developer Certificate of Origin (DCO). This document was created by the Linux Kernel community and is a simple statement that you, as a contributor, have the legal right to make the contribution. See the [DCO.md](DCO.md) file for details.

Loading