Skip to content

Commit 224d508

Browse files
authored
Merge pull request #5 from fraya/master
Update repository
2 parents 581e83f + c92dccb commit 224d508

File tree

12 files changed

+314
-0
lines changed

12 files changed

+314
-0
lines changed

.github/workflows/build-docs.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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: Bypassing Jekyll on GH Pages
45+
run: sudo touch documentation/build/html/.nojekyll
46+
47+
- name: Deploy documents to GH pages
48+
uses: JamesIves/github-pages-deploy-action@v4
49+
with:
50+
folder: documentation/build/html

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*~
2+
/_build/
3+
/registry/
4+
/_packages/
5+
/documentation/build/

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# MIME type library for Dylan
2+
3+
This repository contains a MIME type library for the Dylan programming language.
4+
For now it contains just simple data types and mappings.
5+
6+
## Documentation
7+
8+
See https://package.opendylan.org/mime
9+
10+
## TODO
11+
12+
- Should be expanded to handle MIME message parsing.
13+
14+
## Contributing
15+
16+
Contributions are welcome! If you’d like to contribute to this project, please follow these steps:
17+
18+
- Fork the repository.
19+
- Create a new branch for your feature or bug fix.
20+
- Submit a pull request describing your changes.
21+
22+
## License
23+
24+
This project is licensed under the MIT License. See the LICENSE file for more details.

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: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
import os
7+
import sys
8+
sys.path.insert(0, os.path.abspath('../../_packages/sphinx-extensions/current/src/sphinxcontrib'))
9+
import dylan.themes as dylan_themes
10+
11+
# -- Project information -----------------------------------------------------
12+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
13+
14+
project = 'MIME'
15+
copyright = '2025, Dylan Hackers'
16+
author = 'Dylan Hackers'
17+
release = '0.1.0'
18+
19+
# -- General configuration ---------------------------------------------------
20+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
21+
22+
extensions = [
23+
'dylan.domain'
24+
]
25+
26+
# The primary domain.
27+
primary_domain = 'dylan'
28+
29+
templates_path = ['_templates']
30+
exclude_patterns = []
31+
32+
# -- Options for HTML output -------------------------------------------------
33+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
34+
35+
html_theme = 'furo'
36+
html_static_path = ['_static']

documentation/source/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
MIME
2+
====
3+
4+
**MIME (Multipurpose Internet Mail Extensions)** defines a standard for
5+
describing the type and structure of digital content.
6+
The **MIME Dylan library** offers tools for parsing, creating, and
7+
manipulating MIME data.
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
reference

documentation/source/reference.rst

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
**************************
2+
The MIME library reference
3+
**************************
4+
5+
.. current-library:: mime
6+
7+
The MIME module
8+
***************
9+
10+
.. current-module:: mime
11+
12+
.. constant:: $default-mime-type-map
13+
14+
.. class:: <invalid-mime-type-error>
15+
:open:
16+
17+
:superclasses: :class:`<mime-error>`
18+
19+
.. class:: <mime-error>
20+
:open:
21+
22+
:superclasses: `<format-string-condition>`, :drm:`<error>`
23+
24+
.. class:: <mime-type-map>
25+
:open:
26+
27+
:superclasses: :drm:`<table>`
28+
29+
.. class:: <mime-type>
30+
:open:
31+
32+
:superclasses: :drm:`<object>`
33+
34+
:keyword required subtype: An instance of :drm:`<byte-string>`.
35+
:keyword required type: An instance of :drm:`<byte-string>`.
36+
37+
.. generic-function:: extension-to-mime-type
38+
:open:
39+
40+
:signature: extension-to-mime-type (extension type-map) => (mt)
41+
42+
:parameter extension: An instance of :drm:`<string>`.
43+
:parameter type-map: An instance of :class:`<mime-type-map>`.
44+
:value mt: An instance of ``false-or(<mime-type>)``.
45+
46+
.. method:: extension-to-mime-type
47+
:specializer: <byte-string>, <mime-type-map>
48+
49+
.. generic-function:: extension-to-mime-type-setter
50+
:open:
51+
52+
:signature: extension-to-mime-type-setter (mt extension type-map) => (mt)
53+
54+
:parameter mt: An instance of :class:`<mime-type>`.
55+
:parameter extension: An instance of :drm:`<string>`.
56+
:parameter type-map: An instance of :class:`<mime-type-map>`.
57+
:value mt: An instance of :class:`<mime-type>`.
58+
59+
.. method:: extension-to-mime-type-setter
60+
:specializer: <mime-type>, <byte-string>, <mime-type-map>
61+
62+
.. generic-function:: load-mime-types
63+
:open:
64+
65+
:signature: load-mime-types (type-map pathname) => ()
66+
67+
:parameter type-map: An instance of :class:`<mime-type-map>`.
68+
:parameter pathname: An instance of ``<pathname>``.
69+
70+
.. method:: load-mime-types
71+
:specializer: <mime-type-map>, <pathname>
72+
73+
.. generic-function:: mime-name
74+
:open:
75+
76+
:signature: mime-name (mt) => (name)
77+
78+
:parameter mt: An instance of :class:`<mime-type>`.
79+
:value name: An instance of :drm:`<byte-string>`.
80+
81+
.. method:: mime-name
82+
:specializer: {<mime-type> in mime}
83+
84+
.. generic-function:: mime-subtype
85+
:open:
86+
87+
:signature: mime-subtype (mt) => (subtype)
88+
89+
:parameter mt: An instance of :class:`<mime-type>`.
90+
:value subtype: An instance of :drm:`<byte-string>`.
91+
92+
.. method:: mime-subtype
93+
:specializer: {<mime-type> in mime}
94+
95+
.. generic-function:: mime-type
96+
:open:
97+
98+
:signature: mime-type (mt) => (type)
99+
100+
:parameter mt: An instance of :class:`<mime-type>`.
101+
:value type: An instance of :drm:`<byte-string>`.
102+
103+
.. method:: mime-type
104+
:specializer: {<mime-type> in mime}
105+
106+
.. generic-function:: mime-type-to-string
107+
108+
:signature: mime-type-to-string (mtype) => (string)
109+
110+
:parameter mtype: An instance of :class:`<mime-type>`.
111+
:value string: An instance of :drm:`<byte-string>`.
112+
113+
.. generic-function:: string-to-mime-type
114+
115+
:signature: string-to-mime-type (string #key class) => (mime-type)
116+
117+
:parameter string: An instance of :drm:`<string>`.
118+
:parameter #key class: An instance of ``subclass(<mime-type>)``.
119+
:value mime-type: An instance of :class:`<mime-type>`.

dylan-package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"dependencies": [ ],
3+
"dev-dependencies": [ "sphinx-extensions" ],
4+
"description": "MIME type library",
5+
"name": "mime",
6+
"version": "0.1.0",
7+
"url": "https://github.com/dylan-lang/mime",
8+
"keywords": [ "mime" ],
9+
"contact": "[email protected]",
10+
"license": "MIT",
11+
"license-url": "https://opensource.org/license/mit"
12+
}
File renamed without changes.

0 commit comments

Comments
 (0)