Compare commits
27 Commits
feature/do
...
958856dcc0
| Author | SHA1 | Date | |
|---|---|---|---|
| 958856dcc0 | |||
| deb30aacea | |||
| 9075b34ca3 | |||
| 7325e3a0c9 | |||
| 34e8ad4eb4 | |||
| 8a6dacf1c8 | |||
|
|
8a65a5e596 | ||
| 47996b81bc | |||
| a2f9622aaa | |||
| 5b3ef929c4 | |||
| d706ba9f56 | |||
| bb4b2ad3f5 | |||
| bd77f0daff | |||
| cd439006bb | |||
| 77eda0841b | |||
| 21b6434145 | |||
| ff4b237651 | |||
| 4b11b0ada2 | |||
| 7e40620df6 | |||
| 4025bf9c7f | |||
| d7a387cf45 | |||
| e56a9fc1b5 | |||
| 948df90006 | |||
| 161ce02042 | |||
| 97ab59a424 | |||
| c3761464ee | |||
| fb32fcfdb1 |
@@ -1 +0,0 @@
|
|||||||
**
|
|
||||||
|
Before Width: | Height: | Size: 18 MiB After Width: | Height: | Size: 18 MiB |
42
.github/workflows/docker.yml
vendored
Normal file
42
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: Docker
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
paths:
|
||||||
|
- "Cargo.toml"
|
||||||
|
pull_request:
|
||||||
|
branches: ["main"]
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
contents: read
|
||||||
|
attestations: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: hustcer/setup-nu@v3
|
||||||
|
- uses: cachix/install-nix-action@v31
|
||||||
|
with:
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
|
- run: nix build .#docker
|
||||||
|
|
||||||
|
- run: |
|
||||||
|
export CARGO_VERSION=$(nu -c "cargo metadata --format-version=1 --no-deps | from json | get packages | first | get version")
|
||||||
|
echo "CARGO_VERSION=$CARGO_VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- run: docker load -i result
|
||||||
|
- name: Log in to registry
|
||||||
|
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
|
- run: docker tag docki:latest "ghcr.io/quirinecker/docki:$CARGO_VERSION"
|
||||||
|
- run: docker tag docki:latest "ghcr.io/quirinecker/docki:latest"
|
||||||
|
- run: docker push ghcr.io/quirinecker/docki:$CARGO_VERSION
|
||||||
|
- run: docker push ghcr.io/quirinecker/docki:latest
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
workflow:
|
|
||||||
rules:
|
|
||||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
|
|
||||||
|
|
||||||
default:
|
|
||||||
image: 'quirinecker/rust-openssl'
|
|
||||||
|
|
||||||
build:
|
|
||||||
script:
|
|
||||||
- cargo build
|
|
||||||
|
|
||||||
test:
|
|
||||||
script:
|
|
||||||
- cargo test
|
|
||||||
|
|
||||||
# publish:
|
|
||||||
# script:
|
|
||||||
# - export CARGO_REGISTRY_TOKEN=$CARGO_TOKEN
|
|
||||||
# - cargo publish
|
|
||||||
|
|
||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -859,7 +859,7 @@ checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "docki"
|
name = "docki"
|
||||||
version = "1.2.1"
|
version = "1.2.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"clap 4.1.8",
|
"clap 4.1.8",
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "docki"
|
name = "docki"
|
||||||
version = "1.2.1"
|
version = "1.2.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "cli for building and publishing documentation using asciidoctor"
|
description = "cli for building and publishing documentation using asciidoctor"
|
||||||
license-file = "LICENSE.txt"
|
license-file = "LICENSE.txt"
|
||||||
authors = ["Quirin Ecker"]
|
authors = ["Quirin Ecker"]
|
||||||
exclude = [
|
exclude = [".gitlab", ".github"]
|
||||||
".gitlab"
|
|
||||||
]
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
FROM rust:slim
|
|
||||||
|
|
||||||
WORKDIR /opt/rust
|
|
||||||
|
|
||||||
RUN apt update \
|
|
||||||
&& apt-get -y upgrade \
|
|
||||||
&& apt-get -y install libssl-dev pkg-config
|
|
||||||
40
README.md
40
README.md
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
## Preview
|
## Preview
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Docki is cli for converting asciidoctor files into html files.
|
Docki is cli for converting asciidoctor files into html files.
|
||||||
|
|
||||||
@@ -29,29 +29,26 @@ docki serve
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Nix
|
|
||||||
|
|
||||||
This installation method is recommended, because it will include both asciidoctor and asciidoctor_revealjs.
|
|
||||||
|
|
||||||
Note: This is the most basic installation. If you are already more experienced, you might want to add it to your shell or home manager configuration.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
nix profile install github:quirinecker/docki
|
|
||||||
```
|
|
||||||
|
|
||||||
### Homebrew
|
### Homebrew
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> Installing it via homebrew will not include asciidoctor_revealjs. It can be installed afterwards with `docki install-reveal`
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
brew tap quirinecker/docki-homebrew https://github.com/quirinecker/docki-homebrew
|
brew tap quirinecker/homebrew-docki https://github.com/quirinecker/homebrew-docki
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
brew install docki
|
brew install docki
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Nix
|
||||||
|
|
||||||
|
If you just want to try it out real quick and the nix package manager is available on your system you can use the following command.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
nix develop github:quirinecker/docki#preview
|
||||||
|
```
|
||||||
|
|
||||||
|
This will open a shell evnironment with docki installed. If you want to install it permanently with nix, i would recommend following the instructions in the [Nix (Advanced, Flake)](#nix-advanced-flake) section.
|
||||||
|
|
||||||
### Cargo
|
### Cargo
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
@@ -61,6 +58,19 @@ brew install docki
|
|||||||
cargo install docki
|
cargo install docki
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
There is also a docker image available to use. It is primarily used for the gh actions.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker pull ghcr.io/quirinecker/docki:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also build it yourself with nix.
|
||||||
|
|
||||||
|
```
|
||||||
|
nix build .#docker && docker load -i result
|
||||||
|
```
|
||||||
|
|
||||||
### Nix (Advanced, Flake)
|
### Nix (Advanced, Flake)
|
||||||
|
|
||||||
|
|||||||
20
flake.nix
20
flake.nix
@@ -120,6 +120,26 @@
|
|||||||
naerskLib = naerskLib;
|
naerskLib = naerskLib;
|
||||||
pkgs = pkgs;
|
pkgs = pkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
docker = pkgs.dockerTools.buildImage {
|
||||||
|
name = "docki";
|
||||||
|
tag = "latest";
|
||||||
|
config = {
|
||||||
|
WorkingDir = "/app";
|
||||||
|
};
|
||||||
|
copyToRoot = pkgs.buildEnv {
|
||||||
|
name = "docki-docker";
|
||||||
|
paths = [
|
||||||
|
pkgs.coreutils
|
||||||
|
pkgs.bash
|
||||||
|
pkgs.cacert
|
||||||
|
(build_docki {
|
||||||
|
naerskLib = naerskLib;
|
||||||
|
pkgs = pkgs;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
11
res/test/docs/slides/index.adoc
Normal file
11
res/test/docs/slides/index.adoc
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
= My cool presentation
|
||||||
|
:author: John Doe
|
||||||
|
:email: john@doe.com
|
||||||
|
|
||||||
|
== First slide
|
||||||
|
|
||||||
|
Content
|
||||||
|
|
||||||
|
== Second slide
|
||||||
|
|
||||||
|
Content
|
||||||
@@ -39,11 +39,12 @@ impl BuildExecution {
|
|||||||
|
|
||||||
|
|
||||||
async fn prepare() -> Result<(), String> {
|
async fn prepare() -> Result<(), String> {
|
||||||
let reveal_version = "3.9.2";
|
let reveal_version = "5.2.1";
|
||||||
let target = format!("https://github.com/hakimel/reveal.js/archive/{reveal_version}.zip");
|
let target = format!("https://github.com/hakimel/reveal.js/archive/{reveal_version}.zip");
|
||||||
|
|
||||||
create_dir_recursive("./docs/slides");
|
create_dir_recursive("./docs/slides");
|
||||||
|
|
||||||
|
let response = reqwest::get(target.clone()).await.unwrap();
|
||||||
let Ok(response) = reqwest::get(target).await else {
|
let Ok(response) = reqwest::get(target).await else {
|
||||||
return Err("could not downlaod revealjs".to_string())
|
return Err("could not downlaod revealjs".to_string())
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -59,12 +59,12 @@ fn build_file(paths: Vec<std::path::PathBuf>) {
|
|||||||
let in_path = paths
|
let in_path = paths
|
||||||
.first()
|
.first()
|
||||||
.expect(invalid_path_message)
|
.expect(invalid_path_message)
|
||||||
|
.strip_prefix(¤t_dir())
|
||||||
|
.expect(invalid_path_message)
|
||||||
.to_str()
|
.to_str()
|
||||||
.expect(invalid_path_message)
|
.expect(invalid_path_message);
|
||||||
.replace(¤t_dir(), "")
|
|
||||||
.replace("/./", "./");
|
|
||||||
|
|
||||||
|
|
||||||
|
let in_path = format!("./{}", in_path);
|
||||||
let result = docki_build(&in_path);
|
let result = docki_build(&in_path);
|
||||||
|
|
||||||
match result {
|
match result {
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ fn test_fetch_asciidoctor_paths_recursive() {
|
|||||||
let paths = fs_util::fetch_paths_recursive("res/test/docs").unwrap();
|
let paths = fs_util::fetch_paths_recursive("res/test/docs").unwrap();
|
||||||
let len = paths.len();
|
let len = paths.len();
|
||||||
dbg!(paths);
|
dbg!(paths);
|
||||||
assert_eq!(len, 5);
|
assert_eq!(len, 6);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user