Skip to content

Commit

Permalink
Update documentation and add NPM publish workflow (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-dejongh authored Dec 10, 2022
1 parent 0e0bf90 commit f706d98
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 15 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: npm-publish
on:
push:
branches:
- main # Change this to your default branch
jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Publish if version has been updated
uses: pascalgn/[email protected]
with: # All of theses inputs are optional
tag_name: "v%s"
tag_message: "v%s"
create_tag: "true"
commit_pattern: "^Release (\\S+)"
workspace: "."
publish_command: "yarn"
publish_args: "--non-interactive"
env: # More info about the environment variables in the README
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings
26 changes: 24 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,47 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.1] -> [0.0.2]
## [1.0.0] -> [1.0.1]

### Added

- NPM publish workflow using [npm-publish-action](https://github.com/marketplace/actions/publish-to-npm)
- README usage description expanded with configuration example

### Fixed

- word concatenations are no longer replaced (bug with 'full stop'-regex)
- alternate glossary location is taken into account by generated links

### Removed

- Removed the TODO list from the main readme file

## [0.0.1] -> [1.0.0]
created by [Stijn Dejongh](https://github.com/stijn-dejongh).

### Added

- Jest runner and basic tests
- ESLint and configuration
- basic Docsify configuration
- make the plugin configurable
- Section with improvements added to README file
- SonarQube definition
- Basic github workflow definition
- make terminology heading depth configurable, see [feature request #1](https://github.com/TheGreenToaster/docsify-glossary/issues/1)

### Fixed

- Replaced deprecated packages with security vulnerabilities
- Issue with multiple terminology replacements
- fix issue with terminology replacements in page headers/titles, see: [bug report #6](https://github.com/TheGreenToaster/docsify-glossary/issues/6)
- fix issue with terminology replacements in code blocks, see: [bug report #4](https://github.com/TheGreenToaster/docsify-glossary/issues/4)
- fix issue with multiple word terms, see: [bug report #13]([bug report #13](https://github.com/TheGreenToaster/docsify-glossary/issues/13))

### Changed

- Updated directory structure to fit common code conventions
- Add unit tests
- Run configurations altered
- Bumped node version to version 18

Expand Down
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,34 @@ An example usage can be found here [./example](./example), it is deployed automa

## Installation

1. Insert script into docsify document

```html
<script src="./docsify-glossary.min.js"></script>
```

1. Create a `_glossary.md` file in the root directory
2. Populate the `_glossary.md` file with terms.
1. Download the latest version of the javascript (from our [releases page](https://github.com/stijn-dejongh/docsify-glossary/releases))
2. Add the script into your docsify source directory
3. Insert script into `docsify.template.js` document
```html
<script src="./docsify-glossary.min.js"></script>
```
4. Create a `_glossary.md` file in the root directory
5. Populate the `_glossary.md` file with terms.

## Plugin Usage

* Terms must be predicated with a consistent Markdown heading to get recognized by the glossary (see configuration)
* Terms are replaced with links in the order that they appear in the glossary file.
* This is especially relevant for nested terminology ( e.g. _API_ and _API Usage_)

### Configuration

This version of the `docsify-glossary` plugin allows you to configure multiple aspects of the glossary.
An example configuration is shown here:
```yaml
glossify: {
debug: false, # default
glossaryLocation: './X_Appendix/Glossary/HOME.md', # default is '_glossary.md'
terminologyHeading: '##', # default is '####', overwrite to fit your glossary heading depth
replaceTitleTerms: false # default is 'true'
}
```

## Running the code

In order to run the code, you will need a node set-up on your local machine.
Expand Down Expand Up @@ -56,11 +69,6 @@ An overview of all the changes made to this codebase can be found in the [CHANGE

* [x] Bump dependency versions
* [x] add unit tests to the code to make this package more maintainable
* [x] make glossary file name/location configurable, see [feature request #1](https://github.com/TheGreenToaster/docsify-glossary/issues/1)
* [x] make terminology heading depth configurable, see [feature request #1](https://github.com/TheGreenToaster/docsify-glossary/issues/1)
* [x] fix issue with terminology replacements in page headers/titles, see: [bug report #6](https://github.com/TheGreenToaster/docsify-glossary/issues/6)
* [x] fix issue with terminology replacements in code blocks, see: [bug report #4](https://github.com/TheGreenToaster/docsify-glossary/issues/4)
* [x] fix issue with multiple word terms, see: [bug report #13]([bug report #13](https://github.com/TheGreenToaster/docsify-glossary/issues/13))



0 comments on commit f706d98

Please sign in to comment.