Skip to content

Commit a19eeb3

Browse files
committed
Refurbish library
- Update .gitignore (Fix #29) - Remove registry/ (Fix #25) - Add package description (Fix #24) - Add CI build and test (Fix #26) - Add documentation (skeleton) (Fix #27) - Update README (Fix #31) - Add CI to build documentation (Fix #28) I have made two GH actions. One is to build and check for link errors when a push or a pull request (PR) is made. The other on push only. If we try to deploy the documentation to GH pages on PR the action don't have permissions to write and fails. So I have done 'build-and-test.yml' so in a PR we can catch any error of broken links in the documentation and when the PR is accepted the push action will deploy the documentation to GH pages with 'build-and-deploy-documentation'.
1 parent 3702932 commit a19eeb3

15 files changed

+329
-20
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and deploy documentation
2+
3+
on:
4+
push:
5+
# all branches
6+
paths:
7+
- 'documentation/**'
8+
9+
# This enables the Run Workflow button on the Actions tab.
10+
workflow_dispatch:
11+
12+
# https://github.com/JamesIves/github-pages-deploy-action#readme
13+
permissions:
14+
contents: write
15+
16+
# Set DYLAN environment variable to GITHUB_WORKSPACE so packages are
17+
# installed in ../../_packages relative to documentation's Makefile
18+
env:
19+
DYLAN: ${{ github.workspace }}
20+
21+
jobs:
22+
23+
build-and-deploy:
24+
runs-on: ubuntu-latest
25+
steps:
26+
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Check links
31+
uses: addnab/docker-run-action@v3
32+
with:
33+
image: ghcr.io/fraya/dylan-docs
34+
options: -v ${{ github.workspace }}/documentation:/docs
35+
run: make linkcheck
36+
37+
- name: Build docs with Furo theme
38+
uses: addnab/docker-run-action@v3
39+
with:
40+
image: ghcr.io/fraya/dylan-docs
41+
options: -v ${{ github.workspace }}/documentation:/docs
42+
run: make html
43+
44+
- name: Upload html artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: command-interface-html
48+
path: documentation/build/html/
49+
50+
- name: Bypassing Jekyll on GH Pages
51+
run: sudo touch documentation/build/html/.nojekyll
52+
53+
- name: Deploy docs to GH pages
54+
uses: JamesIves/github-pages-deploy-action@v4
55+
with:
56+
folder: documentation/build/html
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and test documentation
2+
3+
on:
4+
push:
5+
# all branches
6+
paths:
7+
- 'documentation/**'
8+
pull_request:
9+
# all branches
10+
paths:
11+
- 'documentation/**'
12+
13+
# This enables the Run Workflow button on the Actions tab.
14+
workflow_dispatch:
15+
16+
# Set DYLAN environment variable to GITHUB_WORKSPACE so packages are
17+
# installed in ../../_packages relative to documentation's Makefile
18+
env:
19+
DYLAN: ${{ github.workspace }}
20+
21+
jobs:
22+
23+
build-and-test:
24+
runs-on: ubuntu-latest
25+
steps:
26+
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Check links
31+
uses: addnab/docker-run-action@v3
32+
with:
33+
image: ghcr.io/fraya/dylan-docs
34+
options: -v ${{ github.workspace }}/documentation:/docs
35+
run: make linkcheck

.github/workflows/build-and-test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and test
2+
3+
on:
4+
push:
5+
# all branches
6+
pull_request:
7+
# all branches
8+
9+
# This enables the Run Workflow button on the Actions tab.
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-and-test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Install Opendylan
20+
uses: dylan-lang/install-opendylan@v3
21+
22+
- name: Download dependencies
23+
run: dylan update
24+
25+
- name: Build tests
26+
run: dylan build command-interface-test
27+
28+
- name: Run tests
29+
run: _build/bin/command-interface-test --progress none --report surefire > _build/TEST-command-interface.xml
30+
31+
- name: Publish Test Report
32+
if: success() || failure()
33+
uses: mikepenz/action-junit-report@v4
34+
with:
35+
report_paths: '**/_build/TEST-*.xml'

.gitignore

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
_build
1+
# backup files
2+
*~
3+
*.bak
4+
.DS_Store
5+
6+
# project file
7+
*.hdp
8+
9+
# documentation build directory
10+
build/
11+
12+
# compiler build directory
13+
_build/
14+
15+
# dylan tool package cache
16+
_packages/
17+
18+
# package registry folder
19+
registry/

README.rst

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,44 @@
11
Command Interface System
22
========================
33

4+
|Build status|
5+
6+
.. image:: https://github.com/dylan-lang/command-interface/actions/workflows/build-and-test.yml/badge.svg
7+
:target: https://github.com/dylan-lang/command-interface/actions/workflows/build-and-test.yml
8+
9+
|Documentation|
10+
11+
.. image:: https://github.com/dylan-lang/command-interface/actions/workflows/build-and-deploy-documentation.yml/badge.svg
12+
:target: https://github.com/dylan-lang/command-interface/actions/workflows/build-and-deploy-documentation.yml
13+
414
This is a system for building command-driven interfaces in Dylan.
515

616
It can currently be used to declaratively design terminal-based
717
command interfaces, commonly called shells or CLIs.
818

9-
We also strive to implement graphical command interfaces in a
10-
similar manner to Symbolics Genera, including support for
11-
full graphical and markup output.
19+
We also strive to implement graphical command interfaces in a similar
20+
manner to `Symbolics Genera
21+
<https://en.wikipedia.org/wiki/Genera_(operating_system)>`_, including
22+
support for full graphical and markup output.
1223

1324
Compiling
1425
---------
1526

16-
All dependencies are in `Open Dylan`_ itself.
27+
Update library dependencies::
28+
29+
dylan update
1730

18-
Just build with::
31+
Build the library, tests and demo with::
1932

20-
$ dylan-compiler -build command-interface
33+
dylan build --all
2134

22-
There also is a demo::
35+
Run the demo::
2336

24-
$ dylan-compiler -build command-interface-demo
25-
$ _build/bin/command-interface-demo
37+
_build/bin/command-interface-demo
2638

27-
As well as some tests::
39+
And the tests::
2840

29-
$ dylan-compiler -build command-interface-test
30-
$ _build/bin/command-interface-test
41+
_build/bin/command-interface-test
3142

3243
Completion in bash
3344
------------------
@@ -39,11 +50,9 @@ interactive shell and from the system shell.
3950
To enable this feature you need to load the shell snippet
4051
printed by the following command into your shell::
4152

42-
$ _build/bin/command-interface-demo bashcomplete
53+
_build/bin/command-interface-demo bashcomplete
4354

4455
Once you do this you can complete and execute all commands
4556
that would be available inside the shell.
4657

4758
This feature is automatically available to library users.
48-
49-
.. _Open Dylan: https://github.com/dylan-lang/opendylan

documentation/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

documentation/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

documentation/source/conf.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Path setup --------------------------------------------------------------
7+
8+
# If extensions (or modules to document with autodoc) are in another directory,
9+
# add these directories to sys.path here. If the directory is relative to the
10+
# documentation root, use os.path.abspath to make it absolute, like shown here.
11+
12+
import os
13+
import sys
14+
15+
sys.path.insert(0, os.path.abspath('../../_packages/sphinx-extensions/current/src/sphinxcontrib'))
16+
17+
import dylan.themes as dylan_themes
18+
19+
# -- Project information -----------------------------------------------------
20+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
21+
22+
project = 'Command interface'
23+
copyright = '2024, Ingo Albrecht'
24+
author = 'Ingo Albrecht'
25+
release = '0.1.0'
26+
27+
# -- General configuration ---------------------------------------------------
28+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
29+
30+
extensions = [
31+
'dylan.domain',
32+
'sphinx.ext.intersphinx'
33+
]
34+
35+
templates_path = ['_templates']
36+
37+
# List of patterns, relative to source directory, that match files and
38+
# directories to ignore when looking for source files.
39+
# This pattern also affects html_static_path and html_extra_path.
40+
exclude_patterns = ['_build']
41+
42+
# This makes it so that each document doesn't have to use
43+
# .. default-domain:: dylan
44+
# but they probably should anyway, so that they can be built separately
45+
# without depending on this top-level config file.
46+
primary_domain = 'dylan'
47+
48+
# -- Options for HTML output -------------------------------------------------
49+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
50+
51+
html_theme = 'furo'
52+
html_static_path = ['_static']
53+
54+
# Ignore certification verification
55+
tls_verify = False

documentation/source/index.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Welcome to Command interface's documentation!
2+
=============================================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
:caption: Contents:
7+
8+
This is a system for building command-driven interfaces in Dylan.
9+
10+
It can currently be used to declaratively design terminal-based
11+
command interfaces, commonly called shells or CLIs.
12+
13+
We also strive to implement graphical command interfaces in a similar
14+
manner to Symbolics Genera, including support for full graphical and
15+
markup output.
16+
17+
18+
Indices and tables
19+
==================
20+
21+
* :ref:`genindex`
22+
* :ref:`modindex`
23+
* :ref:`search`

dylan-package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "command-interface",
3+
"description": "Interactive command interface system for Dylan",
4+
"keywords": [ "command-line" ],
5+
"version": "0.1.1",
6+
"url": "https://github.com/dylan-lang/command-interface",
7+
"category" : "utilities",
8+
"contact": "dylan-lang@googlegroups.com",
9+
"dependencies": [],
10+
"dev-dependencies": [
11+
"testworks@3.2.0",
12+
"sphinx-extensions@0.2.0"
13+
],
14+
"license": "MIT",
15+
"license-url": "https://opensource.org/license/mit"
16+
}

registry/generic/command-interface

Lines changed: 0 additions & 1 deletion
This file was deleted.

registry/generic/command-interface-demo

Lines changed: 0 additions & 1 deletion
This file was deleted.

registry/generic/command-interface-test

Lines changed: 0 additions & 1 deletion
This file was deleted.

registry/generic/tty

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)