Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pdf
result
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# Skribi documentation (README)

This documentation specifies how Skribi works and how to use it.
This new version is made in Typst so that we can have easily a good visual.
It may also be easy to share this document and to use it with PDF readers.

To open the document, you can do :

```sh
nix run github:Dibi-programming-language/skribi_doc
```

This will open the last official version of the document.

A website may be made later.
Note that this is easy to create a website from a Typst document.
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
description = "Build pipeline for the Skribi documentation";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
utils.url = "github:numtide/flake-utils";
};

outputs =
{
nixpkgs,
utils,
...
}:
utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
typst = (
pkgs.typst.withPackages (
ps: with ps; [
zebraw_0_6_1
vibrant-color_0_2_0
]
)
);
path = "${typst}/lib/typst/packages";
doc = pkgs.stdenv.mkDerivation {
src = ./.;
name = "skribi_doc";
nativeBuildInputs = [
typst
];
TYPST_PACKAGE_CACHE_PATH=path;
TYPST_PACKAGE_PATH=path;
buildPhase = ''
typst compile main.typ
'';
installPhase = ''
mv main.pdf $out
'';
};
open = pkgs.writeShellScriptBin "open_doc" ''
xdg-open ${doc}
'';
in
{
packages = rec {
skribi_doc = open;
default = skribi_doc;
};
devShells.default = pkgs.mkShell {
inputsFrom = [ doc ];
buildInputs = [ open ];
};
}
);
}
100 changes: 100 additions & 0 deletions main.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#import "@preview/zebraw:0.6.1": *
#import "@preview/vibrant-color:0.2.0": *
#show: zebraw

#show: doc => vibrant-color(
theme: "green-theme",
title: "Documentation",
authors: (
"Dev team",
),
lang: "en",
sub-authors: "Skribi",
description: "An introduction to Skribi, with its specifications",
subject: "Skribi",
doc
)

#set document(
title: "An introduction on Skribi",
)

#set raw(syntaxes: "skribi.sublime-syntax")

= Introduction

This document is created for explaining how to use the Skribi, and having every
decision in the same place. You will find specifications about the language,
a tutorial that explains how to use it, and the basics of how it is made.

= A good start

== Downloading Skribi

All information about downloading Skribi can be found on #link(
"https://github.com/Dibi-programming-language/Skribi-langage-source"
)[this page]. For now, you will need to build the code yourself.

The best way to use Skribi is to install it using nix:
```sh
nix profile install github:Dibi-programming-language/Skribi-langage-source
```

And run it using:
```sh
skribi [path to file]
```

#line()

If you want to test Skribi, you can use:
```sh
nix run github:Dibi-programming-language/Skribi-langage-source
```

Skribi will not be kept on your system after this command.

== Using skribi

To use Skribi, you may want to provide a Skribi file.

```sh
skribi your_file.skrb
```

Only `.skrb` and `.skribi` are accepted as valid files.

= Specifications

You can write Skribi code anywhere in a Skribi file: you do not need a main
function to start coding.

#warning("None of these specifications are implemented yet.")

== Calling a function

=== Native functions

You can use native functions to communicate with the outside of your script.

The syntax of a native function is:
```skribi
skr_app name(args)
```

This will call the function named ```skribi name```.
We need to specify the ```skribi skr_app``` as it would be considered as a user
defined function otherwise.

#quote([
Why do we need to make a difference between user defined functions and skribi
defined functions ?

#line()

This is an implementation choice: skribi defined functions are from a limited
list, and implemented in a totally different way. This allows to perform
limited checks on these functions.
])


22 changes: 22 additions & 0 deletions skribi.sublime-syntax
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
%YAML 1.2
---
# https://www.sublimetext.com/docs/syntax.html

name: skribi
file_extensions: [skrb]
scope: source.skrb

contexts:
main:
- match: \b(skr_app|ij|sula|ci|ums)\b
scope: keyword.control.c
- match: '"'
push: skr

skr:
- meta_scope: string.quoted.double.c
- match: \\.
scope: constant.character.escape.c
- match: '"'
pop: true