~arcade/hcwiki-devel

Scott Little: 2
 Add man pages
 Add Scdoc build to default.nix

 5 files changed, 144 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~arcade/hcwiki-devel/patches/25271/mbox | git am -3
Learn more about email & git

[PATCH 1/2] Add man pages Export this patch

This adds real man pages for the cli, config file, and wiki entries.
---
 hcwiki-entry.5.scd | 38 ++++++++++++++++++++++++++++++++++++
 hcwiki.1.scd       | 48 ++++++++++++++++++++++++++++++++++++++++++++++
 hcwiki.5.scd       | 37 +++++++++++++++++++++++++++++++++++
 3 files changed, 123 insertions(+)
 create mode 100644 hcwiki-entry.5.scd
 create mode 100644 hcwiki.1.scd
 create mode 100644 hcwiki.5.scd

diff --git a/hcwiki-entry.5.scd b/hcwiki-entry.5.scd
new file mode 100644
index 0000000..9d95020
--- /dev/null
+++ b/hcwiki-entry.5.scd
@@ -0,0 +1,38 @@
hcwiki-entries(5)

# NAME

hcwiki - format for writing entries

# FRONT MATTER

Each article *must* have a vaild list of tags in its front matter.
Front matter is delimited by an opening and closing pair of '---' ("bounds").
Inside the bounds must reside vaild YAML. Currently, the only supported attribute is 'tags':
a list of strings to tag the article with.

Examples:
```
---
tags: ["uwu", "owo", "much magic"]
---
# Actual content goes here
```

```
---
tags: ["all", "your", "tags"]
---
# Foo, Bar
```

# CONTENT

After the front matter comes content.
Content must be vaild gemtext.
(See https://gemini.circumlunar.space/docs/gemtext.gmi)

Links *must not* point off the local wiki.

# SEE ALSO
*hcwiki(1)* *hcwiki(5)*
diff --git a/hcwiki.1.scd b/hcwiki.1.scd
new file mode 100644
index 0000000..77dd235
--- /dev/null
+++ b/hcwiki.1.scd
@@ -0,0 +1,48 @@
hcwiki(1)

# NAME

hcwiki COMMAND [NAME...]

# DESCRIPTION

hcwiki compiles and maintains a gemini-based wiki system.
Each entry has one or more tags, as defined by the page's front matter. (see
*hcwiki(5)* for more information on front matter).++
Input files are rendered to gemtext ant them placed in an output directory to be
served.

# COMMANDS

*build*
	Trigger a rebuild of all files and tags added
*list*
	Show all added articles
*s <QUERY>*
	Search for QUERY in all articles and print the results
*edit <NAME>*
	Edit the contents of the page called NAME.gmi
*read [PAGE]*
	Read a page named PAGE
*help*
	Show quick usage

# EXIT STATUS

None, so far :(

# ENVIRONMENT

*VISUAL*
	If VISUAL is set, use it's contents to edit pages
*EDITOR*
	If VISUAL is *not* set and EDITOR is set, use EDITOR to edit pages

# NOTES

This is not fully stabilized, expect everything to change

# SEE ALSO
*hcwiki(5)* *hcwiki-entries(5)*

Written by Madeline
diff --git a/hcwiki.5.scd b/hcwiki.5.scd
new file mode 100644
index 0000000..2f80983
--- /dev/null
+++ b/hcwiki.5.scd
@@ -0,0 +1,37 @@
hcwiki(5)

# NAME

hcwiki - documentation for the contfiguration

# OPTIONS

The configuration file is a TOML document, with the following settings:

*PathToSource*:
	The directory that the wiki files are stored in.
*PathToOutupt*:
	Where to write the compiled wiki to.
*TagFile*:
	Location to write the JSON tags to.
*HomePage*:
	Page to display by default.
*ServedLocation*:
	The url that the wiki is accessable from.
*InvaildPage*:
	???
	
# EXAMPLE:

```
# config.toml
PathToSource = "/opt/hcwiki"
PathToOutput = "/srv/pub/gmi"
TagFile = "/opt/hcwiki/.tags.json"
HomePage = "index.gmi"
ServedLocation = "gemini://localhost:1965/"
InvalidPage = "51.gmi"
```

# SEE ALSO
*hcwiki(1)* *hcwiki-entry(5)*
\ No newline at end of file
-- 
2.33.0

[PATCH 2/2] Add Scdoc build to default.nix Export this patch

---
 default.nix | 24 ++++++++++++++++++++----
 shell.nix   |  1 +
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/default.nix b/default.nix
index b25493b..6f31136 100644
--- a/default.nix
+++ b/default.nix
@@ -3,20 +3,36 @@ pkgs.buildGoPackage rec {
  pname = "hcwiki";
  version = "v1.2.0";

  nativeBuildInputs = with pkgs; [ amfora ];
  nativeBuildInputs = with pkgs; [ amfora scdoc ];

  src = pkgs.fetchFromSourcehut {
    owner = "~arcade";
    repo = "hcwiki";
    rev = version;
    sha256 = "1plzwzdql4f5wy3h0kbsln7xdl8qv3a0mbs8ylraqxjkkwdvv3wv";
  };
    };

  goDeps = ./deps.nix;
  goPackagePath = "hcwiki";

  buildInputs = [
    pkgs.go
    pkgs.gzip
    pkgs.scdoc
  ];

  postBuild = ''
  pushd go/src/hcwiki
  command -v scdoc || exit 0
  for page in hcwiki.1 hcwiki.5 hcwiki-entry.5; do
  IN=$(printf "%s.scd" $page)
  scdoc < $IN > $page
  gzip $page
  done 
  popd 
  '';
  preInstall = ''
  cd go/src/hcwiki
  for page in *.gz; do
  install -Dm644 $page $out/man/$page
  done
  '';
}
diff --git a/shell.nix b/shell.nix
index 0f3d2f5..65d1b0f 100644
--- a/shell.nix
+++ b/shell.nix
@@ -5,5 +5,6 @@ pkgs.mkShell {
    #go
    amfora
    agate
    scdoc
  ];
}
-- 
2.33.0