-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from fraya/infrastructure
Infrastructure and documentation update
- Loading branch information
Showing
13 changed files
with
536 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Build and check documentation | ||
|
||
on: | ||
pull_request: | ||
# all branches | ||
paths: | ||
- 'documentation/**' | ||
|
||
# This enables the Run Workflow button on the Actions tab. | ||
workflow_dispatch: | ||
|
||
# Set DYLAN environment variable to GITHUB_WORKSPACE so packages are | ||
# installed in ../../_packages relative to documentation's Makefile | ||
env: | ||
DYLAN: ${{ github.workspace }} | ||
|
||
jobs: | ||
|
||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check links | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/fraya/dylan-docs | ||
options: -v ${{ github.workspace }}/documentation:/docs | ||
run: make linkcheck | ||
|
||
- name: Build docs with Furo theme | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/fraya/dylan-docs | ||
options: -v ${{ github.workspace }}/documentation:/docs | ||
run: make html | ||
|
||
- name: Upload html artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: json | ||
path: documentation/build/html/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Build and deploy documentation | ||
|
||
on: | ||
push: | ||
# all branches | ||
paths: | ||
- 'documentation/**' | ||
|
||
# This enables the Run Workflow button on the Actions tab. | ||
workflow_dispatch: | ||
|
||
# https://github.com/JamesIves/github-pages-deploy-action#readme | ||
permissions: | ||
contents: write | ||
|
||
# Set DYLAN environment variable to GITHUB_WORKSPACE so packages are | ||
# installed in ../../_packages relative to documentation's Makefile | ||
env: | ||
DYLAN: ${{ github.workspace }} | ||
|
||
jobs: | ||
|
||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check links | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/fraya/dylan-docs | ||
options: -v ${{ github.workspace }}/documentation:/docs | ||
run: make linkcheck | ||
|
||
- name: Build docs with Furo theme | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/fraya/dylan-docs | ||
options: -v ${{ github.workspace }}/documentation:/docs | ||
run: make html | ||
|
||
- name: Upload html artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: json | ||
path: documentation/build/html/ | ||
|
||
- name: Bypassing Jekyll on GH Pages | ||
run: sudo touch documentation/build/html/.nojekyll | ||
|
||
- name: Deploy docs to GH pages | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: documentation/build/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
_build | ||
# backup files | ||
*~ | ||
*.bak | ||
.DS_Store | ||
|
||
# project file | ||
*.hdp | ||
|
||
# documentation build directory | ||
/documentation/build/ | ||
|
||
# compiler build directory | ||
/_build/ | ||
|
||
# dylan tool package cache | ||
/_packages/ | ||
|
||
# package registry folder | ||
/registry/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# JSON | ||
|
||
Opendylan library to parse the JSON standard file format. | ||
|
||
## Install | ||
|
||
Add `json` to your project dependencies | ||
|
||
```json | ||
"dependencies": [ "json" ], | ||
``` | ||
|
||
Update the dependencies: | ||
|
||
``` | ||
dylan update | ||
``` | ||
|
||
## Usage | ||
|
||
Add `use json;` in the library and module section of your | ||
`library.dylan` file. | ||
|
||
This library exports the following methods: | ||
|
||
- `parse-json` and | ||
- `print-json` | ||
|
||
### Parse JSON | ||
|
||
An example of usage of `parse-json`: | ||
|
||
```dylan | ||
let json = """ | ||
{ | ||
"a": 1, | ||
"b": 2 | ||
} | ||
"""; | ||
let json-table = parse-json(json); | ||
format-out("a = %d", json-table["a"]); | ||
``` | ||
|
||
[Run this code](https://play.opendylan.org/shared/d123253033bda66a) in | ||
https://play.opendylan.org | ||
|
||
### Print JSON | ||
|
||
`print-json` is used to pretty print a `table` in JSON format, | ||
following the previous example: | ||
|
||
```dylan | ||
print-json(json-table, *standard-output*, indent: 2); | ||
``` | ||
|
||
[Run a complete example](https://play.opendylan.org/shared/06af84b39fab129b) in | ||
https://play.opendylan.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
project = 'Json' | ||
copyright = '2024, Dylan Hackers' | ||
author = 'Dylan Hackers' | ||
release = '1.1.1' | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
import sys, os | ||
sys.path.insert(0, os.path.abspath('../../_packages/sphinx-extensions/current/src/sphinxcontrib')) | ||
|
||
import dylan.themes as dylan_themes | ||
extensions = ['dylan.domain'] | ||
|
||
templates_path = ['_templates'] | ||
exclude_patterns = [] | ||
|
||
primary_domain = 'dylan' | ||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = 'furo' | ||
html_static_path = ['_static'] | ||
|
||
# Ignore certification verification | ||
tls_verify = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
json | ||
==== | ||
|
||
.. current-library: json | ||
.. toctree:: | ||
:maxdepth: 2 | ||
:hidden: | ||
|
||
reference | ||
|
||
This library provides essential functionality for working with JSON | ||
data. JSON (JavaScript Object Notation) is a lightweight data | ||
interchange format that is easy for humans to read and write, and easy | ||
for machines to parse and generate. | ||
|
||
The json library offers two primary methods to facilitate the | ||
conversion between JSON strings and Dylan data structures, making it | ||
straightforward to integrate JSON data handling into your Open Dylan | ||
applications. This methods are: | ||
|
||
:gf:`parse-json` | ||
This method takes a JSON-formatted string and converts it into an | ||
Open Dylan table. This function is useful when you need to process | ||
JSON data received from external sources, such as web APIs or | ||
configuration files. | ||
|
||
:gf:`print-json` | ||
The ``print-json`` function takes an Open Dylan table and converts | ||
it into a formatted JSON string. This is useful for serializing | ||
Open Dylan data structures into JSON format for storage, | ||
transmission, or display purposes. | ||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` |
Oops, something went wrong.