Skip to content

Commit

Permalink
commit all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
wolthom committed Jul 9, 2024
1 parent ffa1aa3 commit cc7cbf3
Show file tree
Hide file tree
Showing 9 changed files with 157 additions and 3 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/documenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Documentation
# This is a standard Julia setup for GitHub CI
on:
push:
branches:
- main # update to match your main branch
tags: '*'
pull_request:

jobs:
build:
permissions:
contents: write
pull-requests: read
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- uses: julia-actions/cache@v1

# Now this is where things focus on the documentation
# build and deployment.

# IMPORTANT! If your documentation is for a Julia package,
# with formal Julia package structure (`src` folder and top level Project.toml)
# then you need to include this extra step (simply uncomment it):

- name: Develop local package
run: julia -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate()'

# The next steps continue with the `doc` folder build.

# This is really all you care about; 2-steps process
# step 1, assumming the documentation Project.toml file is in `docs` folder
- name: Install docs dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.instantiate()'
# step 2 (note project path remains the same!)
- name: Build and deploy
env:
# An access token must be provided to "push" the documentation build.
# GitHub automates this via your account with this line:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# See the discussion around "TagBot" in the Documenter.jl website:
# https://documenter.juliadocs.org/stable/man/hosting/#GitHub-Actions
# for automating creating tagged documentation builds after
# registering your package in the Julia General Registry
run: julia --project=docs/ docs/make.jl
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# AdventOfCode2022.jl
My Julia solutions to 2022's Advent of Code

This package contains my solutions for the 2022 edition of [Advent of Code](https://adventofcode.com/2022) challenges.
Additionally, it provides some useful helpers to download the challenge data and run/benchmark the various days.

## References
- AoC Solution Time charts: https://www.maurits.vdschee.nl/scatterplot/
- High-performance Rust solutions: https://github.com/SkiFire13/adventofcode-2022-rs

See the following links for:

- [Solution Time charts](https://www.maurits.vdschee.nl/scatterplot/) for the Advent of Code challenges
- Reference [high-performance Rust solutions](https://github.com/SkiFire13/adventofcode-2022-rs)
4 changes: 4 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
AdventOfCode2022 = "79bfa421-b4fd-41d1-8cfd-e57d9c314976"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
25 changes: 25 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cd(@__DIR__) # go into `docs` folder

using Pkg
Pkg.activate(".")

using Documenter, Literate, AdventOfCode2022

# convert tutorial/examples to markdown
Literate.markdown("./src/tutorial.jl", "./src")

# Which markdown files to compile to HTML
# (which is also the sidebar and the table
# of contents for your documentation)
pages = [
"Introduction" => "index.md",
"Tutorial" => "tutorial.md",
"API" => "api.md",
]

# compile to HTML:
makedocs(sitename="AoC2022"; pages, modules=[AdventOfCode2022], remotes=nothing, warnonly=true)

deploydocs(
repo="github.com/wolthom/AdventOfCode2022.jl.git",
)
4 changes: 4 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Full API surface

```@autodocs
```
1 change: 1 addition & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Hello
22 changes: 22 additions & 0 deletions docs/src/tutorial.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# # [AdventOfCode2022.jl Tutorial](@id tutorial)

# `AdventOfCode2022` is a package that contains solutions and helper functions for the 2022 Advent of Code edition in Julia.
# This tutorial will walk you through its main functionality and how to use the helpers.
# Note: This Tutorial assumes that you have a session token from the Advent of Code website.

# ## Tutorial - copy-pasteable version

# ```julia
# using AdventOfCode2022
# st = ENV["session"]
# @run_days 22 st
# ```

# ## Using the package
using AdventOfCode2022

# ## Example of retrieving the session key
st = ENV["session"]

# ## Actually running the solutions
@run_days 22 st
40 changes: 40 additions & 0 deletions docs/src/tutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
```@meta
EditURL = "tutorial.jl"
```

# [AdventOfCode2022.jl Tutorial](@id tutorial)

`AdventOfCode2022` is a package that contains solutions and helper functions for the 2022 Advent of Code edition in Julia.
This tutorial will walk you through its main functionality and how to use the helpers.
Note: This Tutorial assumes that you have a session token from the Advent of Code website.

## Tutorial - copy-pasteable version

```julia
using AdventOfCode2022
st = ENV["session"]
@run_days 22 st
```

## Using the package

````@example tutorial
using AdventOfCode2022
````

## Example of retrieving the session key

````@example tutorial
st = ENV["session"]
````

## Actually running the solutions

````@example tutorial
@run_days 22 st
````

---

*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*

3 changes: 3 additions & 0 deletions src/AdventOfCode2022.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Example doc string
"""
module AdventOfCode2022
using Reexport

Expand Down

0 comments on commit cc7cbf3

Please sign in to comment.