Moved manpage to scdoc for generation

This commit is contained in:
Nox Sluijtman 2022-08-23 20:58:04 +02:00
parent a047837800
commit c740bdf525
4 changed files with 494 additions and 121 deletions

View file

@ -2,12 +2,12 @@
# Maintainer: Marty Sluijtman <marty.wanderer@disroot.org> # Maintainer: Marty Sluijtman <marty.wanderer@disroot.org>
pkgname=sheet-parser pkgname=sheet-parser
pkgver=0.2 pkgver=0.2
pkgrel=2 pkgrel=3
pkgdesc="A little D&D character sheet parser written in go" pkgdesc="A little D&D character sheet parser written in go"
url="https://gitlab.com/EternalWanderer/sheet-parser" url="https://gitlab.com/EternalWanderer/sheet-parser"
arch="all" arch="all"
license="GPL-3.0" license="GPL-3.0"
makedepends="go" makedepends="go scdoc"
subpackages="$pkgname-doc subpackages="$pkgname-doc
$pkgname-zsh-completion $pkgname-zsh-completion
" "
@ -28,7 +28,7 @@ package() {
} }
sha512sums=" sha512sums="
7741c79b743660b5aa92b52b69950927329b9c85eb502b97fff23ce5a40852af5f2b4dfa245d3a2c30d7897a22cc955b11f3ff1a24563d2196ae7b26adcb7dec sheet-parser-0.2.tar.gz ac8bfc5f66d3205cd56852f3e5b95e7bd1009132b85a219ad994d05722b3e9823e5e5e33f127f894e75212c5f977f7699d543c75b63f2af69ec10a14699c2f52 sheet-parser-0.2.tar.gz
c1b69e08ee1a660ac106967595ca0f13b036d1bfcb3ca55d3eb49aa1247b44b0762640474b721dd9839d666aaffe75e2d2ea8d4b9af6a841c619b337a98ee380 zsh.completion c1800a72d8d229d46a7ea2dffb83f97c7edaf773a9a875a2ae10b449ae84ab854b80eac05a62002f6a686bb8b014c9b1bc8e2359286b2edccda4d90227a473e5 zsh.completion
ab6b9e0f9b1532c0e14e8995c2c77851d449d019edd675c6c6474b8f230c3b9547c36ebc7eeb318f7ec2a695d07c009e3df35a9984fc4570d71181aa730d6852 example.json ab6b9e0f9b1532c0e14e8995c2c77851d449d019edd675c6c6474b8f230c3b9547c36ebc7eeb318f7ec2a695d07c009e3df35a9984fc4570d71181aa730d6852 example.json
" "

View file

@ -1,5 +1,6 @@
VERSION = 0.2 VERSION = 0.2
PREFIX = /usr/local PREFIX = /usr/local
MANPAGE = sheet-parser.1
MANPREFIX = $(PREFIX)/share/man MANPREFIX = $(PREFIX)/share/man
ZSH_COMPLETION_OUTPUT := zsh.completion ZSH_COMPLETION_OUTPUT := zsh.completion
@ -13,22 +14,22 @@ sheet-parser:
clean: clean:
rm -f sheet-parser sheet-parser-$(VERSION).tar.gz rm -f sheet-parser sheet-parser-$(VERSION).tar.gz
dist: clean dist: clean $(MANPAGE)
mkdir -p sheet-parser-$(VERSION) mkdir -p sheet-parser-$(VERSION)
cp -R example.json $(ZSH_COMPLETION_OUTPUT) LICENSE Makefile README.md sheet-parser.1 $(SRC) sheet-parser-$(VERSION) cp -R example.json $(ZSH_COMPLETION_OUTPUT) LICENSE Makefile README.md $(MANPAGE) $(SRC) sheet-parser-$(VERSION)
tar -cf sheet-parser-$(VERSION).tar sheet-parser-$(VERSION) tar -cf sheet-parser-$(VERSION).tar sheet-parser-$(VERSION)
gzip sheet-parser-$(VERSION).tar gzip sheet-parser-$(VERSION).tar
rm -rf sheet-parser-$(VERSION) rm -rf sheet-parser-$(VERSION)
install: all install: all
install -m 0775 -d $(DESTDIR)$(PREFIX)/bin install -dm 0755 $(DESTDIR)$(PREFIX)/bin
install -m 755 sheet-parser $(DESTDIR)$(PREFIX)/bin install -m 0755 sheet-parser $(DESTDIR)$(PREFIX)/bin
install -m 0775 -d $(DESTDIR)$(MANPREFIX)/man1 install -dm 0755 $(DESTDIR)$(MANPREFIX)/man1
install -m 644 sheet-parser.1 $(DESTDIR)$(MANPREFIX)/man1 install -m 0644 $(MANPAGE) $(DESTDIR)$(MANPREFIX)/man1
uninstall: uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/sheet-parser\ rm -f $(DESTDIR)$(PREFIX)/bin/sheet-parser\
$(DESTDIR)$(MANPREFIX)/man1/sheet-parser.1 $(DESTDIR)$(MANPREFIX)/man1/$(MANPAGE)
package: dist package: dist
rsync --progress sheet-parser-$(VERSION).tar.gz voidDroplet:/var/www/alpine/src/ rsync --progress sheet-parser-$(VERSION).tar.gz voidDroplet:/var/www/alpine/src/
@ -36,4 +37,7 @@ package: dist
abuild checksum abuild checksum
abuild -r abuild -r
$(MANPAGE): $(MANPAGE).scd
scdoc < $< > $@
.PHONY: all sheet-parser clean dist install uninstall package .PHONY: all sheet-parser clean dist install uninstall package

View file

@ -1,124 +1,362 @@
.TH SHEET-PARSER 1 .\" Generated by scdoc 1.11.2
.\" Complete documentation for this program is not available as a GNU info page
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.nh
.ad l
.\" Begin generated content:
.TH "sheet-parser" "1" "2022-08-23"
.P
.SH NAME .SH NAME
sheet-parser \- D&D sheet parser utility written in go .P
sheet-parser - D&D sheet parser utility written in go
.P
.SH SYNOPSIS .SH SYNOPSIS
.B sheet-parser .P
.OP -f <file> \fBsheet-parser\fR [\fB-f\fR \fI<file>\fR] [\fB--file\fR \fI<file>\fR]
.OP --file <file> .P
.PP \fBsheet-parser\fR [\fB-t\fR] [\fB--trivia\fR]
.B sheet-parser .P
.OP -t \fBsheet-parser\fR [\fB-v\fR] [\fB--verbose\fR]
.OP --trivia .P
.PP \fBsheet-parser\fR [\fB--advantage\fR] [\fB--disadvantage\fR]
.B sheet-parser .P
.OP -v \fBsheet-parser\fR [\fB--skill-list\fR] [\fB--stat-list\fR]
.OP --verbose .P
.PP \fBsheet-parser\fR [\fB--stat\fR \fI<stat>\fR] [\fB--save\fR \fI<stat>\fR] [\fB--skill\fR \fI<skill>\fR]
.B sheet-parser .P
.OP --advantage
.OP --disadvantage
.PP
.B sheet-parser
.OP --skill-list
.OP --stat-list
.PP
.B sheet-parser
.OP --stat <stat>
.OP --save <stat>
.OP --skill <skill>
.PP
.SH DESCRIPTION .SH DESCRIPTION
.B sheet-parser .P
is a little utility written with the purpose of being able to parse 5e D&D sheets. \fBsheet-parser\fR is a little utility written with the purpose of being able to parse 5e D&D sheets.\&
Digging through all the different stats and skills and keeping track of their modifiers got a rather tiresome after a while. Digging through all the different stats and skills and keeping track of their modifiers got a rather tiresome after a while.\&
.P
This thing makes use of some of the functionality of This thing makes use of some of the functionality of dice-roller, mainly the way it deals with advantage and disadvantage.\&
.B dice-roller, .P
mainly the way it deals with advantage and disadvantage.
.SH OPTIONS .SH OPTIONS
.TP .P
.B -f --file \fB-f --file\fR
Specify path to character sheet. .RS 4
An example character sheet can be found at '/etc/sheet-parser/example.json' Specify path to character sheet.\& Example character sheet can be found at
.TP \&'\&/etc/sheet-parser/example.\&json'\&
.B -v --verbose .P
Show more stat information; to be used in conjuction with --skill-list or --stat-list .RE
.TP \fB-v --verbose\fR
.B --skill <skill> .RS 4
Used to roll a skill check, standard skill options are listed in a later section. Show more information; to be used in conjunction with \fB--skill-list\fR or
.TP \fB--stat-list\fR
.B --stat <stat> .P
Used to roll a skill check, standard stat options are in a later section. .RE
.TP \fB-t --trivia\fR
.B --save <stat> .RS 4
Used to roll a saving throw, standard stat options are in a later section. Used to print character sheet'\&s name, race, class, level and proficiency
.TP bonus
.B -t --trivia .P
Used to print sheet's name, race, class, level and proficiency bonus. .RE
.TP \fB--stat\fR \fI<stat>\fR
.B --advantage .RS 4
Roll a check with 2d20 and take the highest number, to be used in conjuction with --save --skill or --stat Roll a stat check, standard stats can be printed using
.TP \fB--stat-list\fR and are also listed in the a dedicated section
.B --disadvantage .P
Roll a check with 2d20 and take the lowest number, to be used in conjuction with --save --skill or --stat .RE
.PP \fB--save\fR \fI<stat>\fR
.RS 4
Roll a saving throw, standard stats can be printed using
\fB--stat-list\fR and are also listed in the a dedicated section
.P
.RE
\fB--skill\fR \fI<skill>\fR
.RS 4
Roll a skill check, standard stats can be printed using
\fB--skill-list\fR and are also listed in the a dedicated section
.P
.RE
\fB--stat-list\fR
.RS 4
Print list of standard stats
.P
.RE
\fB--skill-list\fR
.RS 4
Print list of standard skills
.P
.RE
\fB-v --verbose\fR
.RS 4
Print given character sheet'\&s scores and modifiers; to be used in
conjunction with \fB--stat-list\fR and \fB--skill-list\fR
.P
.RE
\fB--advantage\fR
.RS 4
Roll a check with 2d20 and take the highest number; to be used in
conjunction with \fB--save\fR \fB--skill\fR or \fB--stat\fR
.P
.RE
\fB--disadvantage\fR
.RS 4
Roll a check with 2d20 and take the lowest number; to be used in
conjunction with \fB--save\fR \fB--skill\fR or \fB--stat\fR
.P
.RE
.SH STATS & SKILLS .SH STATS & SKILLS
\fBsheet-parser\fR makes use of stats and skills according to the rules of D&D 5e.\&
.B sheet-parser This means that the modifies of all the skills and stats are based on the scores
makes use of stats and skills according to the rules of D&D 5e. This means that the modifiers of all skills and stats are based on the scores of the stats. of the stats.\&
.P
.B Default stats are: \fBDefault stats are:\fR
.RS .RS 4
.IP \[bu] 2 .RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
strength strength
.IP \[bu] 2 .RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
dexterity dexterity
.IP \[bu] 2 .RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
constitution constitution
.IP \[bu] 2 .RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
intelligence intelligence
.IP \[bu] 2 .RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
wisdom wisdom
.IP \[bu] 2 .RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
charisma charisma
.RE .RE
.B Default skills are: .RE
.RS \fBDefault skills are:\fR
.IP \[bu] 2 .RS 4
athletics .RS 4
.IP \[bu] 2 .ie n \{\
acrobatics \h'-04'\(bu\h'+03'\c
.IP \[bu] 2 .\}
sleight_of_hand .el \{\
.IP \[bu] 2 .IP \(bu 4
stealth .\}
.IP \[bu] 2 athletics
arcana .RE
.IP \[bu] 2 .RS 4
history .ie n \{\
.IP \[bu] 2 \h'-04'\(bu\h'+03'\c
investigation .\}
.IP \[bu] 2 .el \{\
nature .IP \(bu 4
.IP \[bu] 2 .\}
religion acrobatics
.IP \[bu] 2 .RE
animal_handling .RS 4
.IP \[bu] 2 .ie n \{\
insight \h'-04'\(bu\h'+03'\c
.IP \[bu] 2 .\}
medicine .el \{\
.IP \[bu] 2 .IP \(bu 4
perception .\}
.IP \[bu] 2 sleight_of_hand
survival .RE
.IP \[bu] 2 .RS 4
deception .ie n \{\
.IP \[bu] 2 \h'-04'\(bu\h'+03'\c
intimidation .\}
.IP \[bu] 2 .el \{\
performance .IP \(bu 4
.IP \[bu] 2 .\}
persuasion stealth
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
arcana
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
history
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
investigation
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
nature
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
religion
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
animal_handling
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
insight
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
medicine
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
perception
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
survival
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
deception
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
intimidation
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
performance
.RE
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.IP \(bu 4
.\}
persuasion
.RE
.P
.RE
.SH CUSTOM CHARACTER SHEETS
To create a custom character sheet, copy the example file to some place where
you can edit it.\&
.P
.nf
.RS 4
cp /etc/sheet-parser/example\&.json foo\&.json
.fi
.RE
.P
From here, the most important fields are the stats scores, the proficiency and
expertise booleans; and the character level as these determine the results of
your rolls.\&
.P
.nf
.RS 4
"misc":{
"level": 1,
\&.\&.\&.
},
"stats":[
{"statName":"strength", "score":20, "proficient":false },
{"statName":"dexterity", "score":1, "proficient":false },
\&.\&.\&.
],
"skills":[
{"skillName":"athletics", "proficient":true, "expertise":false, "baseStat":"strength"},
{"skillName":"acrobatics", "proficient":false, "expertise":false, "baseStat":"dexterity"}
\&.\&.\&.
]
.fi
.RE .RE

131
sheet-parser.1.scd Normal file
View file

@ -0,0 +1,131 @@
sheet-parser(1)
# NAME
sheet-parser - D&D sheet parser utility written in go
# SYNOPSIS
*sheet-parser* [*-f* _<file>_] [*--file* _<file>_]
*sheet-parser* [*-t*] [*--trivia*]
*sheet-parser* [*-v*] [*--verbose*]
*sheet-parser* [*--advantage*] [*--disadvantage*]
*sheet-parser* [*--skill-list*] [*--stat-list*]
*sheet-parser* [*--stat* _<stat>_] [*--save* _<stat>_] [*--skill* _<skill>_]
# DESCRIPTION
*sheet-parser* is a little utility written with the purpose of being able to parse 5e D&D sheets.
Digging through all the different stats and skills and keeping track of their modifiers got a rather tiresome after a while.
This thing makes use of some of the functionality of dice-roller, mainly the way it deals with advantage and disadvantage.
# OPTIONS
*-f --file*
Specify path to character sheet. Example character sheet can be found at
'/etc/sheet-parser/example.json'
*-v --verbose*
Show more information; to be used in conjunction with *--skill-list* or
*--stat-list*
*-t --trivia*
Used to print character sheet's name, race, class, level and proficiency
bonus
*--stat* _<stat>_
Roll a stat check, standard stats can be printed using
*--stat-list* and are also listed in the a dedicated section
*--save* _<stat>_
Roll a saving throw, standard stats can be printed using
*--stat-list* and are also listed in the a dedicated section
*--skill* _<skill>_
Roll a skill check, standard stats can be printed using
*--skill-list* and are also listed in the a dedicated section
*--stat-list*
Print list of standard stats
*--skill-list*
Print list of standard skills
*-v --verbose*
Print given character sheet's scores and modifiers; to be used in
conjunction with *--stat-list* and *--skill-list*
*--advantage*
Roll a check with 2d20 and take the highest number; to be used in
conjunction with *--save* *--skill* or *--stat*
*--disadvantage*
Roll a check with 2d20 and take the lowest number; to be used in
conjunction with *--save* *--skill* or *--stat*
# STATS & SKILLS
*sheet-parser* makes use of stats and skills according to the rules of D&D 5e.
This means that the modifies of all the skills and stats are based on the scores
of the stats.
*Default stats are:*
- strength
- dexterity
- constitution
- intelligence
- wisdom
- charisma
*Default skills are:*
- athletics
- acrobatics
- sleight_of_hand
- stealth
- arcana
- history
- investigation
- nature
- religion
- animal_handling
- insight
- medicine
- perception
- survival
- deception
- intimidation
- performance
- persuasion
# CUSTOM CHARACTER SHEETS
To create a custom character sheet, copy the example file to some place where
you can edit it.
```
cp /etc/sheet-parser/example.json foo.json
```
From here, the most important fields are the stats scores, the proficiency and
expertise booleans; and the character level as these determine the results of
your rolls.
```
"misc":{
"level": 1,
...
},
"stats":[
{"statName":"strength", "score":20, "proficient":false },
{"statName":"dexterity", "score":1, "proficient":false },
...
],
"skills":[
{"skillName":"athletics", "proficient":true, "expertise":false, "baseStat":"strength"},
{"skillName":"acrobatics", "proficient":false, "expertise":false, "baseStat":"dexterity"}
...
]
```