27 Commits

Author SHA1 Message Date
958856dcc0 updated crates ignore list 2025-11-08 19:44:21 +01:00
deb30aacea updated test to new file structure 2025-11-08 19:36:49 +01:00
9075b34ca3 version increment 2025-11-08 19:32:44 +01:00
7325e3a0c9 added working dir for the github actions 2025-11-07 13:03:40 +01:00
34e8ad4eb4 fixed path issue on macos 2025-11-07 12:28:30 +01:00
8a6dacf1c8 Merge pull request #3 from bauepete/patch-1
Update Homebrew installation instructions in README
2025-11-07 10:37:15 +01:00
Peter Bauer
8a65a5e596 Update Homebrew installation instructions in README
Removed note about Homebrew installation not including asciidoctor_revealjs.
2025-11-07 10:36:01 +01:00
47996b81bc Update README.md 2025-10-26 21:54:05 +01:00
a2f9622aaa added the readme once again 2025-10-26 21:51:51 +01:00
5b3ef929c4 now only pushing when the version actually changes 2025-10-26 17:01:42 +01:00
d706ba9f56 added instructions for building it using git pull 2025-10-26 16:56:41 +01:00
bb4b2ad3f5 also tagging latest now 2025-10-26 16:53:09 +01:00
bd77f0daff fixed typo 2025-10-26 16:40:44 +01:00
cd439006bb pushing latest too now 2025-10-26 16:34:53 +01:00
77eda0841b added right push url 2025-10-26 16:26:42 +01:00
21b6434145 writing cargo version to github env now 2025-10-26 16:20:55 +01:00
ff4b237651 wrong command for getting cargo version 2025-10-26 16:04:23 +01:00
4b11b0ada2 changed push url added auth for ghcr 2025-10-26 15:57:30 +01:00
7e40620df6 changed url and added publish step 2025-10-26 15:48:58 +01:00
4025bf9c7f added nix action 2025-10-26 14:39:51 +01:00
d7a387cf45 added docker gh action 2025-10-26 14:08:55 +01:00
e56a9fc1b5 added instructions for docker and moved the screencast asset to antoher folder 2025-10-26 13:58:15 +01:00
948df90006 removed outdated gitlab ci file 2025-10-26 13:51:28 +01:00
161ce02042 removed docker related files 2025-10-26 13:50:59 +01:00
97ab59a424 test docs also have slides now, if slides need to be tested 2025-10-26 13:48:41 +01:00
c3761464ee added docker target to flake 2025-10-26 13:48:16 +01:00
fb32fcfdb1 updated reveal js version 2025-10-26 13:47:59 +01:00
13 changed files with 108 additions and 54 deletions

View File

@@ -1 +0,0 @@
**

View File

Before

Width:  |  Height:  |  Size: 18 MiB

After

Width:  |  Height:  |  Size: 18 MiB

42
.github/workflows/docker.yml vendored Normal file
View 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

View File

@@ -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
View File

@@ -859,7 +859,7 @@ checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0"
[[package]]
name = "docki"
version = "1.2.1"
version = "1.2.2"
dependencies = [
"bytes",
"clap 4.1.8",

View File

@@ -1,13 +1,11 @@
[package]
name = "docki"
version = "1.2.1"
version = "1.2.2"
edition = "2021"
description = "cli for building and publishing documentation using asciidoctor"
license-file = "LICENSE.txt"
authors = ["Quirin Ecker"]
exclude = [
".gitlab"
]
exclude = [".gitlab", ".github"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -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

View File

@@ -6,7 +6,7 @@
## Preview
![screencast](.gitlab/screencast.gif)
![screencast](.github/assets/screencast.gif)
Docki is cli for converting asciidoctor files into html files.
@@ -29,29 +29,26 @@ docki serve
## 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
> [!NOTE]
> Installing it via homebrew will not include asciidoctor_revealjs. It can be installed afterwards with `docki install-reveal`
```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
```
### 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
> [!NOTE]
@@ -61,6 +58,19 @@ brew 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)

View File

@@ -120,6 +120,26 @@
naerskLib = naerskLib;
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;
})
];
};
};
}
);
};

View File

@@ -0,0 +1,11 @@
= My cool presentation
:author: John Doe
:email: john@doe.com
== First slide
Content
== Second slide
Content

View File

@@ -39,11 +39,12 @@ impl BuildExecution {
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");
create_dir_recursive("./docs/slides");
let response = reqwest::get(target.clone()).await.unwrap();
let Ok(response) = reqwest::get(target).await else {
return Err("could not downlaod revealjs".to_string())
};

View File

@@ -59,12 +59,12 @@ fn build_file(paths: Vec<std::path::PathBuf>) {
let in_path = paths
.first()
.expect(invalid_path_message)
.strip_prefix(&current_dir())
.expect(invalid_path_message)
.to_str()
.expect(invalid_path_message)
.replace(&current_dir(), "")
.replace("/./", "./");
.expect(invalid_path_message);
let in_path = format!("./{}", in_path);
let result = docki_build(&in_path);
match result {

View File

@@ -5,5 +5,5 @@ fn test_fetch_asciidoctor_paths_recursive() {
let paths = fs_util::fetch_paths_recursive("res/test/docs").unwrap();
let len = paths.len();
dbg!(paths);
assert_eq!(len, 5);
assert_eq!(len, 6);
}