A Wiki.js updater
yarn install
npm link
Create a new .env
file:
cp .env-example .env
and fill out our Wiki.js instance address and access token.
List all editable properties of a Page object.
./bin/wikijs-cli.js list-page-fields
List all pages available on the Wiki.js host.
./bin/wikijs-cli.js list-pages
Retrieve properties of a Page object using its id
field.
./bin/wikijs-cli.js get-page 1
Retrieve only the text content:
./bin/wikijs-cli.js get-page --text 1
Update a Page object based on its id
field.
./bin/wikijs-cli.js update-page 2 data.json
Update only the text content of a page.
./bin/wikijs-cli.js update-page 2 --text content.txt
Insert new content into a downloaded Wiki.js page. By default the update will be appended to the content marked by {tagname}...{/tagname}
where tagname
can be set on the command line or read from the CONTENT_TAG
environment variable.
./bin/updater-cli.js old_content.txt update.txt > new_content.txt
Optionally provide a minimum similarity score before new data is appended to the text
./bin/updater-cli.js --similarity 0.9 old_content.txt update.txt > new_content.txt
Optionally overwrite existing tag sections
./bin/updater-cli.js --overwrite old_content.txt update.txt > new_content.txt