Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
khawarizmus committed Apr 8, 2024
0 parents commit 5b4236e
Show file tree
Hide file tree
Showing 15 changed files with 1,320 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Typst document
on: [push, workflow_dispatch]

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Typst
uses: lvignoli/typst-action@v0
with:
source_file: |
main.typ
- name: Upload PDF file
uses: actions/upload-artifact@v3
with:
name: PDFs
path: |
main.pdf
- name: Get current date
id: date
run: echo "DATE=$(date +%Y-%m-%d-%H:%M)" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
if: github.ref_type == 'tag'
with:
name: "${{ github.ref_name }} — ${{ env.DATE }}"
files: "*.pdf"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pdf
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"nvarner.typst-lsp",
"mgt19937.typst-preview",
"calebfiggers.typst-companion"
]
}
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2024-Present Mohsen Alyafei and Al-Kawarizmi

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Hijri Week Calendar Standard

> [!IMPORTANT]
> This is proposal is still at a draft stage and will undergo some changes.
This is the home repo for the Hijri Week Calendar Standard. The standard is a proposal for an ISO 8601 counterpart for Hijri week dates. The standard is intended to be used in conjunction with already existing Islamic calendar standards, such as the Umm al-Qura calendar, and is designed to be as compatible as possible with the ISO 8601 calendar.

For more information, see the [standard](standard.md).

## Implementation

The standard is implemented in the following programming languages:

- [Javascript](https://github.com/khawarizmus/hijri-week-calendar)

## Champions

- [MohsenAlyafei](https://github.com/MohsenAlyafei)
- [Khawarizmus](https://github.com/khawarizmus)

## Credits

- [khalid-hussain](https://github.com/khalid-hussain) for proofreading and providing feedback.

## License

This project is licensed under the ISC license - see the [LICENSE](LICENSE) file for details.
Empty file added constants.typ
Empty file.
396 changes: 396 additions & 0 deletions content.typ

Large diffs are not rendered by default.

Binary file added images/table-01.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/table-02.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
307 changes: 307 additions & 0 deletions lapreprint.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
#let template(
// The paper's title.
title: "Paper Title",
subtitle: none,

// An array of authors. For each author you can specify a name, orcid, and affiliations.
// affiliations should be content, e.g. "1", which is shown in superscript and should match the affiliations list.
// Everything but but the name is optional.
authors: (),
// This is the affiliations list. Include an id and `name` in each affiliation. These are shown below the authors.
affiliations: (),
// The paper's abstract. Can be omitted if you don't have one.
abstract: none,
// The short-title is shown in the running header
short-title: none,
// The short-citation is shown in the running header, if set to auto it will show the author(s) and the year in APA format.
short-citation: auto,
// The venue is show in the footer
venue: none,
// An image path that is shown in the top right of the page. Can also be content.
logo: none,
// A DOI link, shown in the header on the first page. Should be just the DOI, e.g. `10.10123/123456` ,not a URL
doi: none,
heading-numbering: "1.a.i",
// Show an Open Access badge on the first page, and support open science, default is true, because that is what the default should be.
open-access: true,
// A list of keywords to display after the abstract
keywords: (),
// The "kind" of the content, e.g. "Original Research", this is shown as the title of the margin content on the first page.
kind: none,
// Content to put on the margin of the first page
// Should be a list of dicts with `title` and `content`
margin: (),
paper-size: "us-letter",
// A color for the theme of the document
theme: blue.darken(30%),
// Date published, for example, when you publish your preprint to an archive server.
// To hide the date, set this to `none`. You can also supply a list of dicts with `title` and `date`.
date: datetime.today(),
// Feel free to change this, the font applies to the whole document
font-face: "Noto Sans",
// The path to a bibliography file if you want to cite some external works.
bibliography-file: none,
bibliography-style: "apa",
// The paper's content.
body
) = {

/* Logos */
let orcidSvg = ```<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24"> <path fill="#AECD54" d="M21.8,12c0,5.4-4.4,9.8-9.8,9.8S2.2,17.4,2.2,12S6.6,2.2,12,2.2S21.8,6.6,21.8,12z M8.2,5.8c-0.4,0-0.8,0.3-0.8,0.8s0.3,0.8,0.8,0.8S9,7,9,6.6S8.7,5.8,8.2,5.8z M10.5,15.4h1.2v-6c0,0-0.5,0,1.8,0s3.3,1.4,3.3,3s-1.5,3-3.3,3s-1.9,0-1.9,0H10.5v1.1H9V8.3H7.7v8.2h2.9c0,0-0.3,0,3,0s4.5-2.2,4.5-4.1s-1.2-4.1-4.3-4.1s-3.2,0-3.2,0L10.5,15.4z"/></svg>```.text

let spacer = text(fill: gray)[#h(8pt) | #h(8pt)]

let dates;
if (type(date) == "datetime") {
dates = ((title: "Published", date: date),)
}else if (type(date) == "dictionary") {
dates = (date,)
} else {
dates = date
}
date = dates.at(0).date

// Create a short-citation, e.g. Cockett et al., 2023
let year = if (date != none) { ", " + date.display("[year]") }
if (short-citation == auto and authors.len() == 1) {
short-citation = authors.at(0).name.split(" ").last() + year
} else if (short-citation == auto and authors.len() == 2) {
short-citation = authors.at(0).name.split(" ").last() + " & " + authors.at(1).name.split(" ").last() + year
} else if (short-citation == auto and authors.len() > 2) {
short-citation = authors.at(0).name.split(" ").last() + " " + emph("et al.") + year
}

// Set document metadata.
set document(title: title, author: authors.map(author => author.name))

show link: it => [#text(fill: theme)[#it]]
show ref: it => [#text(fill: theme)[#it]]

set page(
paper-size,
margin: (left: 25%),
header: locate(loc => {
if(loc.page() == 1) {
let headers = (
if (open-access) {smallcaps[Open Access]},
if (doi != none) { link("https://doi.org/" + doi, "https://doi.org/" + doi)}
)
return align(left, text(size: 8pt, fill: gray, headers.filter(header => header != none).join(spacer)))
} else {
return align(right, text(size: 8pt, fill: gray.darken(50%),
(short-title, short-citation).join(spacer)
))
}
}),
footer: block(
width: 100%,
stroke: (top: 1pt + gray),
inset: (top: 8pt, right: 2pt),
[
#grid(columns: (75%, 25%),
align(left, text(size: 9pt, fill: gray.darken(50%),
(
if(venue != none) {emph(venue)},
if(date != none) {date.display("[month repr:long] [day], [year]")}
).filter(t => t != none).join(spacer)
)),
align(right)[
#text(
size: 9pt, fill: gray.darken(50%)
)[
#counter(page).display() of #locate((loc) => {counter(page).final(loc).first()})
]
]
)
]
)
)
// Set the body font.
set text(font: font-face, size: 10pt)
// Configure equation numbering and spacing.
set math.equation(numbering: "(1)")
show math.equation: set block(spacing: 1em)
// Configure lists.
set enum(indent: 10pt, body-indent: 9pt)
set list(indent: 10pt, body-indent: 9pt)
// Configure headings.
set heading(numbering: heading-numbering)
show heading: it => locate(loc => {
// Find out the final number of the heading counter.
let levels = counter(heading).at(loc)
set text(10pt, weight: 400)
if it.level == 1 [
// First-level headings are centered smallcaps.
// We don't want to number of the acknowledgment section.
#let is-ack = it.body in ([Acknowledgment], [Acknowledgement])
// #set align(center)
#set text(if is-ack { 10pt } else { 12pt })
#show: smallcaps
#v(20pt, weak: true)
#if it.numbering != none and not is-ack {
numbering(heading-numbering, ..levels)
[.]
h(7pt, weak: true)
}
#it.body
#v(13.75pt, weak: true)
] else if it.level == 2 [
// Second-level headings are run-ins.
#set par(first-line-indent: 0pt)
#set text(style: "italic")
#v(10pt, weak: true)
#if it.numbering != none {
numbering(heading-numbering, ..levels)
[.]
h(7pt, weak: true)
}
#it.body
#v(10pt, weak: true)
] else [
// Third level headings are run-ins too, but different.
#if it.level == 3 {
numbering(heading-numbering, ..levels)
[. ]
}
_#(it.body):_
]
})
if (logo != none) {
place(
top,
dx: -33%,
float: false,
box(
width: 27%,
{
if (type(logo) == "content") {
logo
} else {
image(logo, width: 100%)
}
},
),
)
}
// Title and subtitle
box(inset: (bottom: 2pt), text(17pt, weight: "bold", fill: theme, title))
if subtitle != none {
parbreak()
box(text(14pt, fill: gray.darken(30%), subtitle))
}
// Authors and affiliations
if authors.len() > 0 {
box(inset: (y: 10pt), {
authors.map(author => {
text(11pt, weight: "semibold", author.name)
h(1pt)
if "affiliations" in author {
super(author.affiliations)
}
if "orcid" in author {
link("https://orcid.org/" + author.orcid)[#box(height: 1.1em, baseline: 13.5%)[#image.decode(orcidSvg)]]
}
}).join(", ", last: ", and ")
})
}

parbreak()

if affiliations.len() > 0 {
box(inset: (bottom: 10pt), {
affiliations.map(affiliation => {
super(affiliation.id)
h(1pt)
affiliation.name
}).join(", ")
})
}


place(
left + bottom,
dx: -33%,
dy: -10pt,
box(width: 27%, {
if (kind != none) {
show par: set block(spacing: 0em)
text(11pt, fill: theme, weight: "semibold", smallcaps(kind))
parbreak()
}
if (dates != none) {
let formatted-dates

grid(columns: (40%, 60%), gutter: 7pt,
..dates.zip(range(dates.len())).map((formatted-dates) => {
let d = formatted-dates.at(0);
let i = formatted-dates.at(1);
let weight = "light"
if (i == 0) {
weight = "bold"
}
return (
text(size: 7pt, fill: theme, weight: weight, d.title),
text(size: 7pt, d.date.display("[month repr:short] [day], [year]"))
)
}).flatten()
)
}
v(2em)
grid(columns: 1, gutter: 2em, ..margin.map(side => {
text(size: 7pt, {
if ("title" in side) {
text(fill: theme, weight: "bold", side.title)
[\ ]
}
set enum(indent: 0.1em, body-indent: 0.25em)
set list(indent: 0.1em, body-indent: 0.25em)
side.content
})
}))
}),
)


let abstracts
if (type(abstract) == "content") {
abstracts = (title: "Abstract", content: abstract)
} else {
abstracts = abstract
}

box(inset: (top: 16pt, bottom: 16pt), stroke: (top: 1pt + gray, bottom: 1pt + gray), {


abstracts.map(abs => {
set par(justify: true)
text(fill: theme, weight: "semibold", size: 9pt, abs.title)
parbreak()
abs.content
}).join(parbreak())
})
if (keywords.len() > 0) {
text(size: 9pt, {
text(fill: theme, weight: "semibold", "Keywords")
h(8pt)
keywords.join(", ")
})
}
v(10pt)

show par: set block(spacing: 1.5em)

// Display the paper's contents.
body

if (bibliography-file != none) {
show bibliography: set text(8pt)
bibliography(bibliography-file, title: text(10pt, "References"), style: bibliography-style)
}
}
Loading

0 comments on commit 5b4236e

Please sign in to comment.