From c740bdf5259286e4842a7014c70fc7282cd8c6c4 Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Tue, 23 Aug 2022 20:58:04 +0200 Subject: [PATCH] Moved manpage to scdoc for generation --- APKBUILD | 8 +- Makefile | 18 +- sheet-parser.1 | 458 ++++++++++++++++++++++++++++++++++----------- sheet-parser.1.scd | 131 +++++++++++++ 4 files changed, 494 insertions(+), 121 deletions(-) create mode 100644 sheet-parser.1.scd diff --git a/APKBUILD b/APKBUILD index c0772cb..2382b40 100644 --- a/APKBUILD +++ b/APKBUILD @@ -2,12 +2,12 @@ # Maintainer: Marty Sluijtman pkgname=sheet-parser pkgver=0.2 -pkgrel=2 +pkgrel=3 pkgdesc="A little D&D character sheet parser written in go" url="https://gitlab.com/EternalWanderer/sheet-parser" arch="all" license="GPL-3.0" -makedepends="go" +makedepends="go scdoc" subpackages="$pkgname-doc $pkgname-zsh-completion " @@ -28,7 +28,7 @@ package() { } sha512sums=" -7741c79b743660b5aa92b52b69950927329b9c85eb502b97fff23ce5a40852af5f2b4dfa245d3a2c30d7897a22cc955b11f3ff1a24563d2196ae7b26adcb7dec sheet-parser-0.2.tar.gz -c1b69e08ee1a660ac106967595ca0f13b036d1bfcb3ca55d3eb49aa1247b44b0762640474b721dd9839d666aaffe75e2d2ea8d4b9af6a841c619b337a98ee380 zsh.completion +ac8bfc5f66d3205cd56852f3e5b95e7bd1009132b85a219ad994d05722b3e9823e5e5e33f127f894e75212c5f977f7699d543c75b63f2af69ec10a14699c2f52 sheet-parser-0.2.tar.gz +c1800a72d8d229d46a7ea2dffb83f97c7edaf773a9a875a2ae10b449ae84ab854b80eac05a62002f6a686bb8b014c9b1bc8e2359286b2edccda4d90227a473e5 zsh.completion ab6b9e0f9b1532c0e14e8995c2c77851d449d019edd675c6c6474b8f230c3b9547c36ebc7eeb318f7ec2a695d07c009e3df35a9984fc4570d71181aa730d6852 example.json " diff --git a/Makefile b/Makefile index 98a02c1..1ffb6be 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ VERSION = 0.2 PREFIX = /usr/local +MANPAGE = sheet-parser.1 MANPREFIX = $(PREFIX)/share/man ZSH_COMPLETION_OUTPUT := zsh.completion @@ -13,22 +14,22 @@ sheet-parser: clean: rm -f sheet-parser sheet-parser-$(VERSION).tar.gz -dist: clean +dist: clean $(MANPAGE) 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) gzip sheet-parser-$(VERSION).tar rm -rf sheet-parser-$(VERSION) install: all - install -m 0775 -d $(DESTDIR)$(PREFIX)/bin - install -m 755 sheet-parser $(DESTDIR)$(PREFIX)/bin - install -m 0775 -d $(DESTDIR)$(MANPREFIX)/man1 - install -m 644 sheet-parser.1 $(DESTDIR)$(MANPREFIX)/man1 + install -dm 0755 $(DESTDIR)$(PREFIX)/bin + install -m 0755 sheet-parser $(DESTDIR)$(PREFIX)/bin + install -dm 0755 $(DESTDIR)$(MANPREFIX)/man1 + install -m 0644 $(MANPAGE) $(DESTDIR)$(MANPREFIX)/man1 uninstall: rm -f $(DESTDIR)$(PREFIX)/bin/sheet-parser\ - $(DESTDIR)$(MANPREFIX)/man1/sheet-parser.1 + $(DESTDIR)$(MANPREFIX)/man1/$(MANPAGE) package: dist rsync --progress sheet-parser-$(VERSION).tar.gz voidDroplet:/var/www/alpine/src/ @@ -36,4 +37,7 @@ package: dist abuild checksum abuild -r +$(MANPAGE): $(MANPAGE).scd + scdoc < $< > $@ + .PHONY: all sheet-parser clean dist install uninstall package diff --git a/sheet-parser.1 b/sheet-parser.1 index 087fc08..2871999 100644 --- a/sheet-parser.1 +++ b/sheet-parser.1 @@ -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 -sheet-parser \- D&D sheet parser utility written in go +.P +sheet-parser - D&D sheet parser utility written in go +.P .SH SYNOPSIS -.B sheet-parser -.OP -f -.OP --file -.PP -.B sheet-parser -.OP -t -.OP --trivia -.PP -.B sheet-parser -.OP -v -.OP --verbose -.PP -.B sheet-parser -.OP --advantage -.OP --disadvantage -.PP -.B sheet-parser -.OP --skill-list -.OP --stat-list -.PP -.B sheet-parser -.OP --stat -.OP --save -.OP --skill -.PP +.P +\fBsheet-parser\fR [\fB-f\fR \fI\fR] [\fB--file\fR \fI\fR] +.P +\fBsheet-parser\fR [\fB-t\fR] [\fB--trivia\fR] +.P +\fBsheet-parser\fR [\fB-v\fR] [\fB--verbose\fR] +.P +\fBsheet-parser\fR [\fB--advantage\fR] [\fB--disadvantage\fR] +.P +\fBsheet-parser\fR [\fB--skill-list\fR] [\fB--stat-list\fR] +.P +\fBsheet-parser\fR [\fB--stat\fR \fI\fR] [\fB--save\fR \fI\fR] [\fB--skill\fR \fI\fR] +.P .SH DESCRIPTION -.B 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 -.B dice-roller, -mainly the way it deals with advantage and disadvantage. +.P +\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.\& +.P +This thing makes use of some of the functionality of dice-roller, mainly the way it deals with advantage and disadvantage.\& +.P .SH OPTIONS -.TP -.B -f --file -Specify path to character sheet. -An example character sheet can be found at '/etc/sheet-parser/example.json' -.TP -.B -v --verbose -Show more stat information; to be used in conjuction with --skill-list or --stat-list -.TP -.B --skill -Used to roll a skill check, standard skill options are listed in a later section. -.TP -.B --stat -Used to roll a skill check, standard stat options are in a later section. -.TP -.B --save -Used to roll a saving throw, standard stat options are in a later section. -.TP -.B -t --trivia -Used to print sheet's name, race, class, level and proficiency bonus. -.TP -.B --advantage -Roll a check with 2d20 and take the highest number, to be used in conjuction with --save --skill or --stat -.TP -.B --disadvantage -Roll a check with 2d20 and take the lowest number, to be used in conjuction with --save --skill or --stat -.PP +.P +\fB-f --file\fR +.RS 4 +Specify path to character sheet.\& Example character sheet can be found at +\&'\&/etc/sheet-parser/example.\&json'\& +.P +.RE +\fB-v --verbose\fR +.RS 4 +Show more information; to be used in conjunction with \fB--skill-list\fR or +\fB--stat-list\fR +.P +.RE +\fB-t --trivia\fR +.RS 4 +Used to print character sheet'\&s name, race, class, level and proficiency +bonus +.P +.RE +\fB--stat\fR \fI\fR +.RS 4 +Roll a stat check, standard stats can be printed using +\fB--stat-list\fR and are also listed in the a dedicated section +.P +.RE +\fB--save\fR \fI\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\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 - -.B sheet-parser -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. - -.B Default stats are: -.RS -.IP \[bu] 2 +\fBsheet-parser\fR 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.\& +.P +\fBDefault stats are:\fR +.RS 4 +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.IP \(bu 4 +.\} strength -.IP \[bu] 2 +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.IP \(bu 4 +.\} dexterity -.IP \[bu] 2 +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.IP \(bu 4 +.\} constitution -.IP \[bu] 2 +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.IP \(bu 4 +.\} intelligence -.IP \[bu] 2 +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.IP \(bu 4 +.\} wisdom -.IP \[bu] 2 +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.IP \(bu 4 +.\} charisma .RE -.B Default skills are: -.RS -.IP \[bu] 2 -athletics -.IP \[bu] 2 -acrobatics -.IP \[bu] 2 -sleight_of_hand -.IP \[bu] 2 -stealth -.IP \[bu] 2 -arcana -.IP \[bu] 2 -history -.IP \[bu] 2 -investigation -.IP \[bu] 2 -nature -.IP \[bu] 2 -religion -.IP \[bu] 2 -animal_handling -.IP \[bu] 2 -insight -.IP \[bu] 2 -medicine -.IP \[bu] 2 -perception -.IP \[bu] 2 -survival -.IP \[bu] 2 -deception -.IP \[bu] 2 -intimidation -.IP \[bu] 2 -performance -.IP \[bu] 2 -persuasion +.RE +\fBDefault skills are:\fR +.RS 4 +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.IP \(bu 4 +.\} +athletics +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.IP \(bu 4 +.\} +acrobatics +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.IP \(bu 4 +.\} +sleight_of_hand +.RE +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.IP \(bu 4 +.\} +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 diff --git a/sheet-parser.1.scd b/sheet-parser.1.scd new file mode 100644 index 0000000..00535f4 --- /dev/null +++ b/sheet-parser.1.scd @@ -0,0 +1,131 @@ +sheet-parser(1) + +# NAME + +sheet-parser - D&D sheet parser utility written in go + +# SYNOPSIS + +*sheet-parser* [*-f* __] [*--file* __] + +*sheet-parser* [*-t*] [*--trivia*] + +*sheet-parser* [*-v*] [*--verbose*] + +*sheet-parser* [*--advantage*] [*--disadvantage*] + +*sheet-parser* [*--skill-list*] [*--stat-list*] + +*sheet-parser* [*--stat* __] [*--save* __] [*--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* __ + Roll a stat check, standard stats can be printed using + *--stat-list* and are also listed in the a dedicated section + +*--save* __ + Roll a saving throw, standard stats can be printed using + *--stat-list* and are also listed in the a dedicated section + +*--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"} + ... +] +```