Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-42023: Add documenteer technote add-author and sync-authors commands #205

Merged
merged 18 commits into from
Dec 12, 2023

Conversation

jonathansick
Copy link
Member

@jonathansick jonathansick commented Dec 7, 2023

  • New command-line interface for technote authors.

    • documenteer technote migrate automates to the process of migrating an old technote to the new format.
    • documenteer technote add-author adds an author to a technote's technote.toml file using data from the authordb.yaml file in https://github.com/lsst/lsst-texmf.
    • documenteer technote sync-authors refreshing author information in a technote.toml file with information from the authordb.yaml file. This requires that individual authors have internal_id fields to correlate with authordb.yaml.

The motivation for adding the add-author and sync-authors commands is to help technote authors use information from lsst-texmf's authordb.yaml file to populate author information in technote.toml. Using these commands ensures that affiliations are consistent and that the internal_id is used to correlate authors within Rubin documentation.

The AuthorDb interface is based on one we wrote into
lsst-sqre/lsst-templatebot-aide, and adapted to use requests.

To improve on the latex encoding to unicode conversion, I'm adopting
pylatexenc. This is a terrific package that replaces a lot of work that
we'd used to to with pandoc or with fragile code of ours.
This class allows us to open and edit a technote.toml file, using
preserved formatting. This is made possible by the tomlkit package.

Notes on type checking:

- Make use of typing casts to help mypy sort through ambiguous types
- Use properties on the TechnoteTomlFile that take care of the casting
This service-layer class will power functionality in the documenteer
CLI. Right now it supports adding an author by ID from the authordb.yaml
file, and synchronizing author information in a technote.toml file.
This CLI will become the basis for future CL tooling from documenteer to
help build and maintain documents.
This command adds and updates authors from authordb.yaml.
TOML doesn't represent null values, so the appropriate action is to omit
the orcid key entirely.
I can't get dotted keys to work, but an inline table is a good fit here.
Right now this service migrates metadata.yaml content into technote.toml
and updates index.rst to have a title, abstract, and References section.
This command, documenteer technote migrate, should speed up the process
of migrating from an original metadata.yaml-based technote to the new
style. Using data from metadata.yaml, it sets up a new technote.toml
file. It also migrates index.rst to the new requirements for title,
abstract and bibliography. Finally, it also adds/overwrites key
infrastructure files (ci.yaml, tox.ini, Makefile, etc). This migration
command should accomplish 90% of the work for authors to migrate their
technotes.
Add a documenteer technote migrate -D option file as well as an
interactive prompt to delete the old metadata.yaml and .travis.yml files
after a technote migration.

People can always use git history to reset this history if run
mistakenl.
Add these to the Makefile and tox.ini used during the migration.
This reduces the chances of errors
@jonathansick jonathansick marked this pull request as ready for review December 12, 2023 19:28
@jonathansick jonathansick merged commit e76c4e6 into main Dec 12, 2023
5 checks passed
@jonathansick jonathansick deleted the tickets/DM-42023 branch December 12, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant