Skip to content

Commit

Permalink
doc: update build-scripts and links
Browse files Browse the repository at this point in the history
  • Loading branch information
getreu committed Mar 19, 2020
1 parent 748ff68 commit d24ca62
Show file tree
Hide file tree
Showing 12 changed files with 501 additions and 36 deletions.
76 changes: 63 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ When invoked with `stringsext -e ascii` **stringsext** can be used
as *GNU strings* replacement.


### Screenshot
## Screenshot

```
stringsext -tx -e utf-8 -e utf-16le -e utf-16be \
Expand All @@ -58,43 +58,89 @@ stringsext -tx -e utf-8 -e utf-16le -e utf-16be \
```


### Documentation
## Documentation

User documentation

* [Manual page](https://blog.getreu.net/projects/stringsext/stringsext--man.html)
* [Manual page (html)](https://blog.getreu.net/projects/stringsext/stringsext--manpage.html)

* [Manual page (pdf)](https://blog.getreu.net/_downloads/stringsext--manpage.pdf)

* [Blogposts about Stringsext](https://blog.getreu.net/tags/stringsext/)

* [Paper about Stringsext](https://commons.erau.edu/jdfsl/vol14/iss2/4)

Developer documentation

* [API documentation](https://blog.getreu.net/projects/stringsext/stringsext/index.html)
* [Forensic Tool Development with Rust](https://blog.getreu.net/projects/forensic-tool-development-with-rust)
* [API documentation](https://blog.getreu.net/projects/stringsext/stringsext/index.html)

* [Forensic Tool Development with Rust](https://blog.getreu.net/projects/forensic-tool-development-with-rust)

### Source code
## Source code

Repository

* [Stringsext on Github](https://github.com/getreu/stringsext)

* [Stringsext on Gitlab](https://gitlab.com/getreu/stringsext)

### Distribution
## Distribution

* Binaries for latest release (Linux, Windows, iOS)

1. Open: [Releases · getreu/stringsext](https://github.com/getreu/stringsext/releases)

2. Open the latest release.

3. Open *assets*.

4. Download the packed executable for your operating system.

5. Installation: see below.

* Binaries and packages (usually built from lastest commit):

- Executable for Windows:

[x86_64-pc-windows-gnu/release/stringsext.exe](https://blog.getreu.net/projects/stringsext/_downloads/x86_64-pc-windows-gnu/release/stringsext.exe)

- Binary for Linux:

Binaries
[x86_64-unknown-linux-gnu/release/stringsext](https://blog.getreu.net/projects/stringsext/_downloads/x86_64-unknown-linux-gnu/release/stringsext)

* [Download](https://blog.getreu.net/projects/stringsext/_downloads/)
[x86_64-unknown-linux-musl/release/stringsext](https://blog.getreu.net/projects/stringsext/_downloads/x86_64-unknown-linux-musl/release/stringsext)

Manual page download
[i686-unknown-linux-gnu/release/stringsext](https://blog.getreu.net/projects/stringsext/_downloads/i686-unknown-linux-gnu/release/stringsext)

* [stringsext.1.gz](https://blog.getreu.net/projects/stringsext/_downloads/stringsext.1.gz),
[i686-unknown-linux-musl/release/stringsext](https://blog.getreu.net/projects/stringsext/_downloads/i686-unknown-linux-musl/release/stringsext)

### Building and installing
- Package for Debian and Ubuntu:

[x86_64-unknown-linux-gnu/debian/stringsext_2.2.0_amd64.deb](https://blog.getreu.net/projects/stringsext/_downloads/x86_64-unknown-linux-gnu/debian/stringsext_2.2.0_amd64.deb)

[i686-unknown-linux-gnu/debian/stringsext_2.2.0_i386.deb](https://blog.getreu.net/projects/stringsext/_downloads/i686-unknown-linux-gnu/debian/stringsext_2.2.0_i386.deb)

* Installable Unix man-page:

- [stringsext.1.gz](https://blog.getreu.net/projects/stringsext/_downloads/stringsext.1.gz)

* Zipfile with all binaries and documentation:

- [stringsext all](https://blog.getreu.net/_downloads/stringsext.zip)



## Building and installing

1. Install *Rust* with [rustup](https://www.rustup.rs/):

curl https://sh.rustup.rs -sSf | sh

The fast-track procedure:

cargo install stringsext
sudo cp ~/.cargo/bin/stringsext /usr/local/bin

2. Download [stringsext](#stringsext):

git clone git@github.com:getreu/stringsext.git
Expand Down Expand Up @@ -127,7 +173,11 @@ Manual page download
Copy the binary `target/release/stringsext.exe` in a directory
listed in your `PATH` environment variable.

# About
This project follows [Semantic Versioning](https://semver.org/).



## About

Author

Expand Down
8 changes: 8 additions & 0 deletions doc/make--all
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

rm -r ./build

./make--index
./make--stringsext--manpage
./make--rustdoc-link

11 changes: 11 additions & 0 deletions doc/make--index
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

mkdir --parents ./build/html
mkdir --parents ./build/html/_downloads
mkdir --parents ./build/man/man1

cp ../README.md ./source/index.md
sed -i 's/http.*\.getreu\.net//g' ./source/index.md

./md2docbook2html ./source/index.md ./build/html/index.html
#rm index.md
11 changes: 11 additions & 0 deletions doc/make--rustdoc-link
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

mkdir --parents ./build/html
mkdir --parents ./build/html/_downloads
mkdir --parents ./build/man/man1

cd ./build/html/_downloads
ln -sf ../../../../target/* .
ln -sf ../../../build/man/man1/stringsext.1.gz .


11 changes: 11 additions & 0 deletions doc/make--stringsext--manpage
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

mkdir --parents ./build/html
mkdir --parents ./build/html/_downloads
mkdir --parents ./build/man/man1

# Html page
./md2man ./source/stringsext--manpage.md ./build/man/man1/stringsext.1
./md2docbook2pdf ./source/stringsext--manpage.md ./build/pdf/stringsext--manpage.pdf
./md2docbook2html ./source/stringsext--manpage.md ./build/html/stringsext--manpage.html

22 changes: 0 additions & 22 deletions doc/make-doc

This file was deleted.

72 changes: 72 additions & 0 deletions doc/md2docbook2html
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash
# Author: Jens Getreu

# apt install pandoc docbook-xsl-ns xsltproc


render () {
### parse args

#set -x
InPath="$1"
InFile="${InPath##*/}"
InBase="${InFile%.*}"
InDir="${InPath%/*}"
if [ "$InDir" = "$InPath" ] ; then
InDir="."
fi

OutPath="$2"
OutFile="${OutPath##*/}"
OutBase="${OutFile%.*}"
OutDir="${OutPath%/*}"
if [ "$OutDir" = "$OutPath" ] ; then
OutDir="."
fi


### Prepare

XmlPath="$OutDir/$OutBase.xml"
HtmlPath="$OutDir/$OutBase.html"
TemplatePath="$OutDir/template.db"
mkdir -p "$OutDir"


### Generate XML

# unfortunately the chain does not honor --number-section yet
pandoc -s -t docbook5 -o "$XmlPath" "$InPath"

# this is only needed for html output
cp -r "$InDir/images/" "$OutDir"
cp "$InDir/docutils_basic.css" "$OutDir"

### Generate HTML

# Xsltproc also take parameters e.g. --stringparam use.extensions 0\
# Schema 1.79.1 does not render figure references correctly:
# /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/html/docbook.xsl\
# Use snapshot with UTF-8 in docbook.xsl instead
xsltproc --stringparam html.stylesheet docutils_basic.css --output "$HtmlPath" \
/usr/local/share/xml/dokbook/stylesheet/docbook-xsl-snapshot/html/docbook.xsl\
"$XmlPath" && \
rm "$XmlPath"
}

#/usr/local/share/xml/dokbook/stylesheet/docbook-xsl-1.79.2/html/docbook.xsl\


### Main
# usage:
# render FILE [FILE]
# render report.md ./rendition/report.html

if [[ -n "${2/[ ]*\n/}" ]] ; then
OutPath="$2"
else
OutPath="${1%.*}.html" # $2 is empty
fi
render "$1" "$OutPath"


81 changes: 81 additions & 0 deletions doc/md2docbook2pdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash
# Author: Jens Getreu

# apt install pandoc asciidoctor-fopub
FOPUB_PATH="/usr/local/java-deployment/asciidoctor-fopub/bin/"

render () {
### parse args

#set -x
InPath="$1"
InFile="${InPath##*/}"
InBase="${InFile%.*}"
InDir="${InPath%/*}"
if [ "$InDir" = "$InPath" ] ; then
InDir="."
fi

OutPath="$2"
OutFile="${OutPath##*/}"
OutBase="${OutFile%.*}"
OutDir="${OutPath%/*}"
if [ "$OutDir" = "$OutPath" ] ; then
OutDir="."
fi


### Prepare

XmlPath="$OutDir/$OutBase.xml"
PdfPath="$OutDir/$OutBase.pdf"
TemplatePath="$OutDir/template.db"

mkdir -p "$OutDir"


### Make docbook-template
# quoting EOF means parameter substitution turned off
cat << "EOF" > "$TemplatePath"
<?xml version="1.0" encoding="utf-8" ?>
<?asciidoc-toc?>
<?asciidoc-numbered?>
EOF



# Strip off first line of the docbook5 default template and append it
pandoc -D docbook5 | tail -n +2 >> "$TemplatePath"


### Generate XML

# unfortunately the chain does not honor --number-section yet
pandoc --template "$TemplatePath" -s -t docbook5 -o "$XmlPath" "$InPath"

# this is only needed for html and xml output
cp -r "$InDir/images/" "$OutDir"


### Generate PDF
"$FOPUB_PATH/fopub" -H "$XmlPath" && \
rm "$XmlPath" && \
rm "$TemplatePath" && \
rm -f -r "$OutDir/images/"

}



### Main
# usage:
# render FILE [FILE]
# render report.md ./rendition/report.pdf

if [[ -n "${2/[ ]*\n/}" ]] ; then
OutPath="$2"
else
OutPath="${1%.*}.pdf" # $2 is empty
fi
render "$1" "$OutPath"

51 changes: 51 additions & 0 deletions doc/md2man
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash
# Author: Jens Getreu


# sudo apt install pandoc

# parse args

render () {
#set -x
InPath="$1"
InFile="${InPath##*/}"
InBase="${InFile%.*}"
InDir="${InPath%/*}"
if [ "$InDir" = "$InPath" ] ; then
InDir="."
fi

OutPath="$2"
OutFile="${OutPath##*/}"
OutBase="${OutFile%.*}"
OutDir="${OutPath%/*}"
if [ "$OutDir" = "$OutPath" ] ; then
OutDir="."
fi


# process

ManFile="$OutBase.1"

mkdir -p "$OutDir"

pandoc -s -t man -o "$OutDir/$ManFile" "$InPath"

gzip -f "$OutDir/$ManFile"
}


### Main
# usage:
# render FILE [FILE]
# render report.md ./rendition/report.1

if [[ -n "${2/[ ]*\n/}" ]] ; then
OutPath="$2"
else
OutPath="${1%.*}.html" # $2 is empty
fi
render "$1" "$OutPath"

Loading

0 comments on commit d24ca62

Please sign in to comment.