Skip to content

Commit

Permalink
Revise README now that packages are live of NuGet
Browse files Browse the repository at this point in the history
* Installation instructions now use NuGet to get the package.
* Removed title section from HTML template: it duplicated a lot of
  stuff.
    * Now that the author isn't shown inline of the page, I can add it
      to the metadata.
* Add highlight style based on the Kate style but with a grey background
  for code.
  • Loading branch information
chwarr committed May 29, 2020
1 parent 8798695 commit 0cdf50f
Show file tree
Hide file tree
Showing 5 changed files with 252 additions and 33 deletions.
40 changes: 23 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# .NET JSON Check
# dnjc, .NET JSON Check

[.NET JSON Check][dnjc], `dnjc`, is a command line tool to check for JSON
syntax errors using the [`System.Text.Json`][stj] parsers.
Expand All @@ -10,27 +10,29 @@ PS> Get-Content "bad.json" | dnjc
6 2 '}' is an invalid start of a value.
```

## Install
The source code [is hosted on GitHub](https://github.com/chwarr/dnjc).

For now, `dnjc` needs to be built from source. It can then be installed with
`dotnet tool install`:
## Install

The source code [is hosted on GitHub](https://github.com/chwarr/dnjc).
`dnjc` can be installed as a [.NET global tool][dotnet-global-tools]:

```powershell
cd /src # Adjust as needed
git clone "https://github.com/chwarr/dnjc.git"
cd dnjc
dotnet pack --configuration Release "dnjc.sln"
dotnet tool install `
--global `
--add-source "/src/dnjc/pack/Release/netcoreapp3.1" `
DotNetJsonCheck.Tool
dotnet tool install --global DotNetJsonCheck.Tool
```

If this is the first .NET global tool you've installed, you may need to
restart your shell/console for it to pick up the changes to your PATH.

## Versions

The current versions of the tool and the library that powers it are shown
below.

| Package | Version |
|---------|---------|
| DotNetJsonCheck.Tool | [![DotNetJsonCheck.Tool NuGet version](https://img.shields.io/nuget/v/DotNetJsonCheck.Tool?logo=nuget&style=flat-square)][nuget-dnjc-tool] |
| DotNetJsonCheck | [![DotNetJsonCheck NuGet version](https://img.shields.io/nuget/v/DotNetJsonCheck?logo=nuget&style=flat-square)][nuget-dnjc] |

## Invocation

After installing, invoke it, giving it the JSON you want to check on
Expand Down Expand Up @@ -83,9 +85,9 @@ example, to allow comments but not trailing commas, pass `--strict
The [Emacs][emacs] package `flycheck-dnjc.el` can be used to configure a
[Flycheck][flycheck] checker that uses `dnjc`.

Install the `flycheck-dnjc.el` from where you cloned this repository.

<kbd>M-x</kbd> `package-install-file` <kbd>RET</kbd> `/src/dnjc/flycheck-dnjc.el`
To install it, [download it][flycheck-dnjc.el] and then install it with
<kbd>M-x</kbd> `package-install-file` <kbd>RET</kbd>
`/path/to/where/you/downloaded/flycheck-dnjc.el`

If you use [`use-package`][use-package] to manage your packages, add this to
your `.emacs` file:
Expand Down Expand Up @@ -152,12 +154,16 @@ FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.

A copy of the GNU Affero General Public License Version 3 is included in the
file [LICENSE].
file [LICENSE] at the root of the repository.

[dnjc]: https://www.thebluepolicebox.com/dnjc/
[dotnet-global-tools]: https://aka.ms/global-tools
[emacs]: https://www.gnu.org/software/emacs/
[flycheck-dnjc.el]: https://raw.githubusercontent.com/chwarr/dnjc/master/emacs/flycheck-dnjc.el
[flycheck]: https://www.flycheck.org/
[LICENSE]: https://github.com/chwarr/dnjc/blob/master/LICENSE
[mecj]: https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.json?view=dotnet-plat-ext-3.1
[nuget-dnjc-tool]: https://www.nuget.org/packages/DotNetJsonCheck.Tool/
[nuget-dnjc]: https://www.nuget.org/packages/DotNetJsonCheck/
[stj]: https://docs.microsoft.com/en-us/dotnet/api/system.text.json?view=netcore-3.1
[use-package]: https://github.com/jwiegley/use-package
4 changes: 2 additions & 2 deletions website/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
.PHONY: all clean
PANDOC = pandoc
PANDOC_SYNTAX_DEFNS = --syntax-definition=syntax/jsonc.xml --syntax-definition=syntax/elisp.xml
PANDOC_OPTS = --highlight-style=kate --standalone --template=template/html.html
PANDOC_OPTS = --highlight-style=syntax/highlight.theme --standalone --template=template/html.html

all: index.html

clean:
rm -f index.html

index.html: ../README.md index.yaml syntax/jsonc.xml syntax/elisp.xml template/html.html
index.html: ../README.md index.yaml syntax/jsonc.xml syntax/elisp.xml syntax/highlight.theme template/html.html
$(PANDOC) $(PANDOC_SYNTAX_DEFNS) $(PANDOC_OPTS) --from=gfm --to=html --metadata-file=index.yaml --output "$@" "$<"
minify "$@" --output "$@"
2 changes: 2 additions & 0 deletions website/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

author:
- Christopher Warrington
lang: en-us
title: 'dnjc, .NET JSON Check: check for JSON errors using .NET'
225 changes: 225 additions & 0 deletions website/syntax/highlight.theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
{
"text-color": "#1f1c1b",
"background-color": "#f2f2f2",
"line-number-color": "#a0a0a0",
"line-number-background-color": "#ffffff",
"text-styles": {
"Other": {
"text-color": "#006e28",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Attribute": {
"text-color": "#0057ae",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"SpecialString": {
"text-color": "#ff5500",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Annotation": {
"text-color": "#ca60ca",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"RegionMarker": {
"text-color": "#0057ae",
"background-color": "#e0e9f8",
"bold": false,
"italic": false,
"underline": false
},
"Function": {
"text-color": "#644a9b",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"String": {
"text-color": "#bf0303",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"ControlFlow": {
"text-color": "#1f1c1b",
"background-color": null,
"bold": true,
"italic": false,
"underline": false
},
"Operator": {
"text-color": "#1f1c1b",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Error": {
"text-color": "#bf0303",
"background-color": null,
"bold": false,
"italic": false,
"underline": true
},
"Normal": {
"text-color": "#1f1c1b",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"BaseN": {
"text-color": "#b08000",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Alert": {
"text-color": "#bf0303",
"background-color": "#f7e6e6",
"bold": true,
"italic": false,
"underline": false
},
"Variable": {
"text-color": "#0057ae",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"BuiltIn": {
"text-color": "#644a9b",
"background-color": null,
"bold": true,
"italic": false,
"underline": false
},
"Extension": {
"text-color": "#0095ff",
"background-color": null,
"bold": true,
"italic": false,
"underline": false
},
"Preprocessor": {
"text-color": "#006e28",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Information": {
"text-color": "#b08000",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"VerbatimString": {
"text-color": "#bf0303",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Warning": {
"text-color": "#bf0303",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Documentation": {
"text-color": "#607880",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Import": {
"text-color": "#ff5500",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Char": {
"text-color": "#924c9d",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"DataType": {
"text-color": "#0057ae",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Float": {
"text-color": "#b08000",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Comment": {
"text-color": "#898887",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"CommentVar": {
"text-color": "#0095ff",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Constant": {
"text-color": "#aa5500",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"SpecialChar": {
"text-color": "#3daee9",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"DecVal": {
"text-color": "#b08000",
"background-color": null,
"bold": false,
"italic": false,
"underline": false
},
"Keyword": {
"text-color": "#1f1c1b",
"background-color": null,
"bold": true,
"italic": false,
"underline": false
}
}
}
14 changes: 0 additions & 14 deletions website/template/html.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,6 @@
$for(include-before)$
$include-before$
$endfor$
$if(title)$
<header id="title-block-header">
<h1 class="title">$title$</h1>
$if(subtitle)$
<p class="subtitle">$subtitle$</p>
$endif$
$for(author)$
<p class="author">$author$</p>
$endfor$
$if(date)$
<p class="date">$date$</p>
$endif$
</header>
$endif$
$if(toc)$
<nav id="$idprefix$TOC" role="doc-toc">
$if(toc-title)$
Expand Down

0 comments on commit 0cdf50f

Please sign in to comment.