Skip to content

Commit

Permalink
Add LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBener committed May 28, 2024
1 parent ccfed13 commit 580e69e
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 16 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Tom Ben

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions _extensions/auto-correct.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Improve copywriting, correct spaces, words, and punctuations between CJK and English with AutoCorrect

# Copyright: © 2024 Tom Ben
# License: MIT License

import panflute as pf
import autocorrect_py as autocorrect
import json
Expand Down
3 changes: 3 additions & 0 deletions _extensions/bib-quotes.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
-- Process quotes for Chinese bibliographies in docx and html output

--- Copyright: © 2024 Tom Ben
--- License: MIT License

function is_chinese(text)
return text:find("[\228-\233][\128-\191][\128-\191]")
end
Expand Down
8 changes: 4 additions & 4 deletions _extensions/citation-backlinks.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
-- Modified from https://github.com/bcdavasconcelos/citetools/blob/main/_extensions/citetools/citation-backlinks.lua
--- Modified from https://github.com/bcdavasconcelos/citetools/blob/main/_extensions/citetools/citation-backlinks.lua

-- Todo: even with link-citations and link-fields turned off, citation-backlinks still adds a single backlink to each reference in the final bibliography div.
--- Todo: even with link-citations and link-fields turned off, citation-backlinks still adds a single backlink to each reference in the final bibliography div.

--- citation-backlinks.lua – adds citation backlinks to the bibliography
---
--- Copyright: © 2023 John MacFarlane and Albert Krewinkel and Bernardo Vasconcelos
-- https://github.com/tarleb/citation-backlinks
--- Copyright: © 2022–2024 John MacFarlane and Albert Krewinkel and Bernardo Vasconcelos
--- License: MIT – see LICENSE for details

-- Makes sure users know if their pandoc version is too old for this
Expand Down
7 changes: 5 additions & 2 deletions _extensions/docx-quotes/docx-quotes.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
-- 1. Convert straight Chinese quotes to Pandoc's Quoted elements (DoubleQuote and SingleQuote)
-- 2. Change Quoted elements to the Chinese style by adding XML tags in the docx output
--- 1. Convert straight Chinese quotes to Pandoc's Quoted elements (DoubleQuote and SingleQuote)
--- 2. Change Quoted elements to the Chinese style by adding XML tags in the docx output

--- Copyright: © 2024 Tom Ben
--- License: MIT License

-- Check if the text contains Chinese characters
function is_chinese(text)
Expand Down
3 changes: 3 additions & 0 deletions _extensions/format-md.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Convert reference-style links to inline links
# Remove line breaks within a straight Chinese quote

# Copyright: © 2024 Tom Ben
# License: MIT License

import re
import glob
import os
Expand Down
9 changes: 6 additions & 3 deletions _extensions/get-bib.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
-- Get a BibTeX/BibLaTeX or CSL JSON file cited from a large database
-- Source: https://pandoc.org/lua-filters.html#pandoc.utils.references
-- https://twitter.com/pandoc_tips/status/1481910457145434113
--- Get a BibTeX/BibLaTeX or CSL JSON file cited from a large database
--- Source: https://pandoc.org/lua-filters.html#pandoc.utils.references
--- https://twitter.com/pandoc_tips/status/1481910457145434113

--- Copyright: © 2022–2024 Albert Krewinkel
--- License: MIT License

-- *Note*: For BibLaTeX, it is needed to change the following entry name:
-- - journal -> journaltitle
Expand Down
11 changes: 7 additions & 4 deletions _extensions/ignore-softbreaks/ignore-softbreaks.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
-- Emulate Pandoc's extension `east_asian_line_breaks` in Quarto
-- Ignore soft break adjacent to Chinese characters
-- Created by ChatGPT based on https://taoshu.in/unix/markdown-soft-break.html
-- Tracking Quarto issue: https://github.com/quarto-dev/quarto-cli/issues/8520
--- Emulate Pandoc's extension `east_asian_line_breaks` in Quarto
--- Ignore soft break adjacent to Chinese characters
--- Created by ChatGPT based on https://taoshu.in/unix/markdown-soft-break.html
--- Tracking Quarto issue: https://github.com/quarto-dev/quarto-cli/issues/8520

--- Copyright: © 2024 Tom Ben
--- License: MIT License

function is_ascii(char)
if char == nil then return false end
Expand Down
5 changes: 5 additions & 0 deletions _extensions/latex-quotes/latex-quotes.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
--- Replaces Straight quotes with German quotes for intermediate in LaTeX output

--- Copyright: © 2024 Tom Ben
--- License: MIT License

function Str(el)
local replacements = {
[''] = '«',
Expand Down
7 changes: 5 additions & 2 deletions _extensions/links-to-citations/links-to-citations.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
-- Remove local links but keep the link text as normal citations
-- Reference: https://stackoverflow.com/a/75559075/19418090
--- Remove local links but keep the link text as normal citations
--- Reference: https://stackoverflow.com/a/75559075/19418090

--- Copyright: © 2023 Albert Krewinkel, 2024 Tom Ben
--- License: MIT License

function Link(link)
if not link.target:match '^https?://' then
Expand Down
5 changes: 5 additions & 0 deletions _extensions/localize-cnbib.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
--- Localize Chinese bibliographies generated by Pandoc Citeproc and CSL

--- Copyright: © 2024 Tom Ben
--- License: MIT License

-- Function to check if a string contains Chinese characters
function contains_chinese(text)
return text and text:find("[\228-\233][\128-\191][\128-\191]") ~= nil
Expand Down
5 changes: 4 additions & 1 deletion _extensions/remove-spaces/remove-spaces.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
-- Remove spaces before or after Chinese characters
--- Remove spaces before or after Chinese characters

--- Copyright: © 2024 Tom Ben
--- License: MIT License

-- Check if the character is non-ASCII (potentially a Chinese character).
local function is_non_ascii(char)
Expand Down
3 changes: 3 additions & 0 deletions _extensions/sort-cnbib.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Sort Chinese bibliography entries by Pinyin
# Be sure to remove the comment block ```{=comment}```

# Copyright: © 2024 Tom Ben
# License: MIT License

import panflute as pf
from pypinyin import pinyin, Style

Expand Down

0 comments on commit 580e69e

Please sign in to comment.