From f1bd176d81872dc587f3c38f3db70fefe9afd7b5 Mon Sep 17 00:00:00 2001 From: Randolf J <34705014+jun-sheaf@users.noreply.github.com> Date: Wed, 2 Dec 2020 21:28:38 +0100 Subject: filters.md: document a new Pandoc filtering framework (#6908) --- doc/filters.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/filters.md b/doc/filters.md index 8b6002467..ce871cb42 100644 --- a/doc/filters.md +++ b/doc/filters.md @@ -253,12 +253,15 @@ repository](https://github.com/jgm/pandocfilters). For a more Pythonic alternative to pandocfilters, see the [panflute](https://pypi.org/project/panflute) library. -Don't like Python? There are also ports of pandocfilters in -[PHP](https://github.com/vinai/pandocfilters-php), -[perl](https://metacpan.org/pod/Pandoc::Filter), -[javascript/node.js](https://github.com/mvhenderson/pandoc-filter-node), -[Groovy](https://github.com/dfrommi/groovy-pandoc), and -[Ruby](https://heerdebeer.org/Software/markdown/paru/). +Don't like Python? There are also ports of pandocfilters in + +- [PHP](https://github.com/vinai/pandocfilters-php), +- [perl](https://metacpan.org/pod/Pandoc::Filter), +- TypeScript/JavaScript via Node.js + - [pandoc-filter](https://github.com/mvhenderson/pandoc-filter-node), + - [node-pandoc-filter](https://github.com/mu-io/node-pandoc-filter), +- [Groovy](https://github.com/dfrommi/groovy-pandoc), and +- [Ruby](https://heerdebeer.org/Software/markdown/paru/). Starting with pandoc 2.0, pandoc includes built-in support for writing filters in lua. The lua interpreter is built in to -- cgit v1.2.3 From c1fb4d3729d9710b8aa8d3c3999c7b18f3c1b125 Mon Sep 17 00:00:00 2001 From: Ian Sullivan Date: Mon, 14 Dec 2020 12:37:17 -0500 Subject: typo --- doc/lua-filters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/lua-filters.md b/doc/lua-filters.md index b715b8218..787365212 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -1513,7 +1513,7 @@ with the [`pandoc.Attr`](#pandoc.attr) constructor. For convenience, it is usually not necessary to construct the value directly if it is part of an element, and it is sufficient to pass an HTML-like table. E.g., to create a span with identifier -"text" and classes "a" and "b", on can write: +"text" and classes "a" and "b", one can write: local span = pandoc.Span('text', {id = 'text', class = 'a b'}) -- cgit v1.2.3 From 7e98562c04be19f533bc806a8525fe203d1ede58 Mon Sep 17 00:00:00 2001 From: wuffi <2758427+wuffi@users.noreply.github.com> Date: Sun, 20 Dec 2020 12:11:42 +0100 Subject: Fixed table with file extensions and interpreters Assigned .pl file extension to perl interpreter and .rb to ruby --- doc/filters.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/filters.md b/doc/filters.md index ce871cb42..46db09f78 100644 --- a/doc/filters.md +++ b/doc/filters.md @@ -503,7 +503,8 @@ extension. ---------------- -------------- .py `python` .hs `runhaskell` - .pl `ruby` + .pl `perl` + .rb `ruby` .php `php` .js `node` .r `Rscript` -- cgit v1.2.3 From d82fe52a02e43d905f34830162def346d851fc5a Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 29 Jan 2021 09:42:25 +0100 Subject: JATS templates: tag author.name as string-name The partitioning the components of a name into surname, given names, etc. is not always possible or not available. Using `author.name` allows to give the full name as a fallback to be used when `author.surname` is not available. --- data/templates/article.jats_publishing | 2 ++ data/templates/default.jats_articleauthoring | 2 ++ doc/jats.md | 5 +++++ 3 files changed, 9 insertions(+) (limited to 'doc') diff --git a/data/templates/article.jats_publishing b/data/templates/article.jats_publishing index 4bdb3f278..15d2e3b08 100644 --- a/data/templates/article.jats_publishing +++ b/data/templates/article.jats_publishing @@ -95,6 +95,8 @@ $if(author.surname)$ $author.surname$ $author.given-names$ +$elseif(author.name)$ +$author.name$ $else$ $author$ $endif$ diff --git a/data/templates/default.jats_articleauthoring b/data/templates/default.jats_articleauthoring index 94c929548..ef2aed769 100644 --- a/data/templates/default.jats_articleauthoring +++ b/data/templates/default.jats_articleauthoring @@ -28,6 +28,8 @@ $if(author.surname)$ $author.surname$ $author.given-names$ +$elseif(author.name)$ +$author.name$ $else$ $author$ $endif$ diff --git a/doc/jats.md b/doc/jats.md index 362ae3bef..0faea8b06 100644 --- a/doc/jats.md +++ b/doc/jats.md @@ -33,6 +33,11 @@ Metadata Values See [``][elem:given-names]. + `name` + : full name of the author; included only as a fallback if + `author.surname` is not available. Tagged with + [``][elem:string-name]. + `email` : the contributor's email address. -- cgit v1.2.3 From 61b108d52789f20fb03c4f8a74719c1d53021c91 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 27 Jan 2021 15:17:39 +0100 Subject: Lua: add module "pandoc.path" The module allows to work with file paths in a convenient and platform-independent manner. Closes: #6001 Closes: #6565 --- doc/lua-filters.md | 172 ++++++++++++++++++++++++++++++++++++++++ pandoc.cabal | 1 + src/Text/Pandoc/Lua/Packages.hs | 2 + stack.yaml | 4 +- test/Tests/Lua/Module.hs | 2 + test/lua/module/pandoc-path.lua | 17 ++++ 6 files changed, 197 insertions(+), 1 deletion(-) create mode 100644 test/lua/module/pandoc-path.lua (limited to 'doc') diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 787365212..33c0d27bd 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -3376,6 +3376,178 @@ methods and convenience functions. `comp`: : Comparison function as described above. +# Module pandoc.path + +Module for file path manipulations. + +## Static Fields {#pandoc.path-fields} + +### separator {#pandoc.path.separator} + +The character that separates directories. + +### search_path_separator {#pandoc.path.search_path_separator} + +The character that is used to separate the entries in the `PATH` +environment variable. + +## Functions {#pandoc.path-functions} + +### directory (filepath) {#pandoc.path.directory} + +Get the directory name; move up one level. + +Parameters: + +filepath +: path (string) + +Returns: + +- The filepath up to the last directory separator. (string) + +### filename (filepath) {#pandoc.path.filename} + +Get the file name. + +Parameters: + +filepath +: path (string) + +Returns: + +- File name part of the input path. (string) + +### is_absolute (filepath) {#pandoc.path.is_absolute} + +Checks whether a path is absolute, i.e. not fixed to a root. + +Parameters: + +filepath +: path (string) + +Returns: + +- `true` iff `filepath` is an absolute path, `false` otherwise. + (boolean) + +### is_relative (filepath) {#pandoc.path.is_relative} + +Checks whether a path is relative or fixed to a root. + +Parameters: + +filepath +: path (string) + +Returns: + +- `true` iff `filepath` is a relative path, `false` otherwise. + (boolean) + +### join (filepaths) {#pandoc.path.join} + +Join path elements back together by the directory separator. + +Parameters: + +filepaths +: path components (list of strings) + +Returns: + +- The joined path. (string) + +### make_relative (path, root[, unsafe]) {#pandoc.path.make_relative} + +Contract a filename, based on a relative path. Note that the +resulting path will usually not introduce `..` paths, as the +presence of symlinks means `../b` may not reach `a/b` if it starts +from `a/c`. For a worked example see [this blog +post](http://neilmitchell.blogspot.co.uk/2015/10/filepaths-are-subtle-symlinks-are-hard.html). + +Set `unsafe` to a truthy value to a allow `..` in paths. + +Parameters: + +path +: path to be made relative (string) + +root +: root path (string) + +unsafe +: whether to allow `..` in the result. (boolean) + +Returns: + +- contracted filename (string) + +### normalize (filepath) {#pandoc.path.normalize} + +Normalizes a path. + +- `//` outside of the drive can be made blank +- `/` becomes the `path.separator` +- `./` -\> '' +- an empty path becomes `.` + +Parameters: + +filepath +: path (string) + +Returns: + +- The normalized path. (string) + +### split (filepath) {#pandoc.path.split} + +Splits a path by the directory separator. + +Parameters: + +filepath +: path (string) + +Returns: + +- List of all path components. (list of strings) + +### split_extension (filepath) {#pandoc.path.split_extension} + +Splits the last extension from a file path and returns the parts. The +extension, if present, includes the leading separator; if the path has +no extension, then the empty string is returned as the extension. + +Parameters: + +filepath +: path (string) + +Returns: + +- filepath without extension (string) + +- extension or empty string (string) + +### split_search_path (search_path) {#pandoc.path.split_search_path} + +Takes a string and splits it on the `search_path_separator` character. +Blank items are ignored on Windows, and converted to `.` on Posix. On +Windows path elements are stripped of quotes. + +Parameters: + +search_path +: platform-specific search path (string) + +Returns: + +- list of directories in search path (list of strings) + # Module pandoc.system Access to system information and functionality. diff --git a/pandoc.cabal b/pandoc.cabal index 2f8c255a8..4b808af84 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -429,6 +429,7 @@ library filepath >= 1.1 && < 1.5, haddock-library >= 1.8 && < 1.10, hslua >= 1.1 && < 1.4, + hslua-module-path >= 0.0.1 && < 0.1.0, hslua-module-system >= 0.2 && < 0.3, hslua-module-text >= 0.2.1 && < 0.4, http-client >= 0.4.30 && < 0.8, diff --git a/src/Text/Pandoc/Lua/Packages.hs b/src/Text/Pandoc/Lua/Packages.hs index 5949a1a7d..2f1c139db 100644 --- a/src/Text/Pandoc/Lua/Packages.hs +++ b/src/Text/Pandoc/Lua/Packages.hs @@ -17,6 +17,7 @@ import Foreign.Lua (NumResults) import Text.Pandoc.Lua.PandocLua (PandocLua, liftPandocLua, loadDefaultModule) import qualified Foreign.Lua as Lua +import qualified Foreign.Lua.Module.Path as Path import qualified Foreign.Lua.Module.Text as Text import qualified Text.Pandoc.Lua.Module.Pandoc as Pandoc import qualified Text.Pandoc.Lua.Module.MediaBag as MediaBag @@ -43,6 +44,7 @@ pandocPackageSearcher pkgName = case pkgName of "pandoc" -> pushWrappedHsFun Pandoc.pushModule "pandoc.mediabag" -> pushWrappedHsFun MediaBag.pushModule + "pandoc.path" -> pushWrappedHsFun Path.pushModule "pandoc.system" -> pushWrappedHsFun System.pushModule "pandoc.types" -> pushWrappedHsFun Types.pushModule "pandoc.utils" -> pushWrappedHsFun Utils.pushModule diff --git a/stack.yaml b/stack.yaml index dc6fa6517..da7acd8db 100644 --- a/stack.yaml +++ b/stack.yaml @@ -10,7 +10,9 @@ extra-deps: - haddock-library-1.9.0 - skylighting-0.10.2 - skylighting-core-0.10.2 -- hslua-1.1.2 +- hslua-1.3.0 +- hslua-module-path-0.0.1 +- hslua-module-text-0.3.0.1 - jira-wiki-markup-1.3.2 - HsYAML-aeson-0.2.0.0 - commonmark-0.1.1.3 diff --git a/test/Tests/Lua/Module.hs b/test/Tests/Lua/Module.hs index d88633cf8..8be445f65 100644 --- a/test/Tests/Lua/Module.hs +++ b/test/Tests/Lua/Module.hs @@ -25,6 +25,8 @@ tests = ("lua" "module" "pandoc-list.lua") , testPandocLua "pandoc.mediabag" ("lua" "module" "pandoc-mediabag.lua") + , testPandocLua "pandoc.path" + ("lua" "module" "pandoc-path.lua") , testPandocLua "pandoc.types" ("lua" "module" "pandoc-types.lua") , testPandocLua "pandoc.util" diff --git a/test/lua/module/pandoc-path.lua b/test/lua/module/pandoc-path.lua new file mode 100644 index 000000000..9a5a3f6c8 --- /dev/null +++ b/test/lua/module/pandoc-path.lua @@ -0,0 +1,17 @@ +local tasty = require 'tasty' +local path = require 'pandoc.path' + +local assert = tasty.assert +local test = tasty.test_case +local group = tasty.test_group + +return { + group 'path separator' { + test('is string', function () + assert.are_same(type(path.separator), 'string') + end), + test('is slash or backslash', function () + assert.is_truthy(path.separator:match '^[/\\]$') + end), + }, +} -- cgit v1.2.3 From f84512228e16e82cfb2197262847974905fb9b29 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 2 Feb 2021 18:21:29 +0100 Subject: Improve docs for directory, normalize --- doc/lua-filters.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 33c0d27bd..0c86d6109 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -3395,7 +3395,8 @@ environment variable. ### directory (filepath) {#pandoc.path.directory} -Get the directory name; move up one level. +Gets the directory name, i.e., removes the last directory +separator and everything after from the given path. Parameters: @@ -3489,8 +3490,10 @@ Returns: Normalizes a path. -- `//` outside of the drive can be made blank -- `/` becomes the `path.separator` +- `//` makes sense only as part of a (Windows) network drive; + elsewhere, multiple slashes are reduced to a single + `path.separator` (platform dependent). +- `/` becomes `path.separator` (platform dependent) - `./` -\> '' - an empty path becomes `.` -- cgit v1.2.3 From 364fe4a03b97f04586194c49e15891ba9a639944 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 4 Feb 2021 15:29:39 +0100 Subject: doc/lua-filters.md: fix, improve docs for `pandoc.mediabag.fetch` --- doc/lua-filters.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 0c86d6109..3b3c03727 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -3176,12 +3176,22 @@ Usage: ### fetch {#pandoc.mediabag.fetch} -`fetch (source, base_url)` +`fetch (source)` Fetches the given source from a URL or local file. Returns two values: the contents of the file and the MIME type (or an empty string). +The function will first try to retrieve `source` from the +mediabag; if that fails, it will try to download it or read it +from the local file system while respecting pandoc's "resource +path" setting. + +Parameters: + +`source`: +: path to a resource; either a local file path or URI + Returns: - the entries MIME type, or nil if the file was not found. @@ -3190,7 +3200,7 @@ Returns: Usage: local diagram_url = "https://pandoc.org/diagram.jpg" - local mt, contents = pandoc.mediabag.fetch(diagram_url, ".") + local mt, contents = pandoc.mediabag.fetch(diagram_url) # Module pandoc.List -- cgit v1.2.3 From 57e56ed55cd278e6c7eb8cf2a0f4b9fa4160781e Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 4 Feb 2021 19:07:59 +0100 Subject: doc/lua-filters.md: improve docs for `pandoc.mediabag.insert` --- doc/lua-filters.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 3b3c03727..a99dc9008 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -3084,7 +3084,8 @@ Clear-out the media bag, deleting all items. `insert (filepath, mime_type, contents)` -Adds a new entry to pandoc's media bag. +Adds a new entry to pandoc's media bag. Replaces any existing +mediabag entry with the same `filepath`. Parameters: @@ -3092,7 +3093,7 @@ Parameters: : filename and path relative to the output folder. `mime_type`: -: the file's MIME type +: the file's MIME type; use `nil` if unknown or unavailable. `contents`: : the binary contents of the file. -- cgit v1.2.3 From 2c99e0e3588d5645e901346572e1b04e8fb4fa3e Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 15 Feb 2021 13:15:14 +0100 Subject: JATS writer: replace attribute "pub-type" with "publication-format". The former attribute is deprecated. --- data/templates/article.jats_publishing | 6 +++--- doc/jats.md | 11 +++++++---- test/writer.jats_archiving | 2 +- test/writer.jats_publishing | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) (limited to 'doc') diff --git a/data/templates/article.jats_publishing b/data/templates/article.jats_publishing index 15d2e3b08..3a3a8f8cf 100644 --- a/data/templates/article.jats_publishing +++ b/data/templates/article.jats_publishing @@ -30,10 +30,10 @@ $if(journal.abbrev-title)$ $endif$ $if(journal.pissn)$ -$journal.pissn$ +$journal.pissn$ $endif$ $if(journal.eissn)$ -$journal.eissn$ +$journal.eissn$ $endif$ $-- At least one issn element is required; use empty issn as fallback $if(journal.pissn)$ @@ -130,7 +130,7 @@ $endif$ $endif$ $if(date)$ - + $if(date.day)$ $date.day$ $endif$ diff --git a/doc/jats.md b/doc/jats.md index 0faea8b06..0e717d0d8 100644 --- a/doc/jats.md +++ b/doc/jats.md @@ -173,7 +173,8 @@ Metadata Values The publication date is recorded in the document via the [``][elem:pub-date] element and its sub-elements. The - [`pub-type`][attr:pub-type] attribute is always set to `epub`. + [`publication-format`][attr:publication-format] attribute is + always set to `electronic`. `iso-8601` : ISO-8601 representation of the publication date. Used as the @@ -300,12 +301,14 @@ Metadata Values `pissn` : ISSN identifier of the publication's print version. Used as content of the [``][elem:issn] element with the - [`pub-type`][attr:pub-type] attribute set to `ppub`. + [`publication-format`][attr:publication-format] attribute + set to `print`. `eissn` : ISSN identifier of the publication's electronic version. Used as content of the [``][elem:issn] element with - the [`pub-type`][attr:pub-type] attribute set to `epub`. + the [`publication-format`][attr:publication-format] + attribute set to `electronic`. `publisher-name` : name of the publishing entity (person, company, or other). @@ -352,7 +355,7 @@ Required metadata values: [attr:kwd-group-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/kwd-group-type.html [attr:license-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/license-type.html [attr:pub-id-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/pub-id-type.html -[attr:pub-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/pub-type.html +[attr:publication-format]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/publication-format.html [attr:ref-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/ref-type.html [attr:rid]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/rid.html [attr:subj-group-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/subj-group-type.html diff --git a/test/writer.jats_archiving b/test/writer.jats_archiving index 2d06c5cab..941f5e87d 100644 --- a/test/writer.jats_archiving +++ b/test/writer.jats_archiving @@ -24,7 +24,7 @@ Anonymous - + 17 7 2006 diff --git a/test/writer.jats_publishing b/test/writer.jats_publishing index 915471576..f7d4a4720 100644 --- a/test/writer.jats_publishing +++ b/test/writer.jats_publishing @@ -24,7 +24,7 @@ Anonymous - + 17 7 2006 -- cgit v1.2.3 From b5b576184c3c1668aad0c904e186136b81a0dd54 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 15 Feb 2021 13:15:14 +0100 Subject: JATS writer: add date-type to pub-date elements --- data/templates/article.jats_publishing | 2 +- doc/jats.md | 13 ++++++++++--- test/writer.jats_archiving | 2 +- test/writer.jats_publishing | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/data/templates/article.jats_publishing b/data/templates/article.jats_publishing index 3a3a8f8cf..47fa4ac62 100644 --- a/data/templates/article.jats_publishing +++ b/data/templates/article.jats_publishing @@ -130,7 +130,7 @@ $endif$ $endif$ $if(date)$ - + $if(date.day)$ $date.day$ $endif$ diff --git a/doc/jats.md b/doc/jats.md index 0e717d0d8..95151d9f1 100644 --- a/doc/jats.md +++ b/doc/jats.md @@ -172,13 +172,13 @@ Metadata Values pass these components directly. The publication date is recorded in the document via the - [``][elem:pub-date] element and its sub-elements. The + [``] element and its sub-elements. The [`publication-format`][attr:publication-format] attribute is always set to `electronic`. `iso-8601` : ISO-8601 representation of the publication date. Used as the - value of the [`pub-date`][elem:pub-date] element's + value of the [``] element's [`iso-8601-date`][attr:iso-8601-date] attribute. This value is set automatically if pandoc can parse the @@ -192,6 +192,12 @@ Metadata Values The values are set automatically if pandoc can parse the `date` value as a date. + `type` + : The type of event marked by this date. The value is set as + the [`date-type`][attr:date-type] attribute on the + [``] element and defaults to "pub" if not + specified. + `article` : information concerning the article that identifies or describes it. The key-value pairs within this map are typically used @@ -348,6 +354,7 @@ Required metadata values: [Ringgold]: https://ringgold.com/ [attr:content-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/content-type.html +[attr:date-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/date-type.html [attr:fn-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/fn-type.html [attr:institution-id-type]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/institution-id-type.html [attr:iso-8601-date]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/attribute/iso-8601-date.html @@ -380,7 +387,6 @@ Required metadata values: [elem:license]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/license.html [elem:notes]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/notes.html [elem:permissions]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/permissions.html -[elem:pub-date]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/pub-date.html [elem:publisher-loc]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/publisher-loc.html [elem:publisher-name]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/publisher-name.html [elem:string-name]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/string-name.html @@ -396,3 +402,4 @@ Required metadata values: [``]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/institution-id.html [``]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/institution-wrap.html [``]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/institution.html +[``]: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/pub-date.html diff --git a/test/writer.jats_archiving b/test/writer.jats_archiving index 941f5e87d..a6ff94bcd 100644 --- a/test/writer.jats_archiving +++ b/test/writer.jats_archiving @@ -24,7 +24,7 @@ Anonymous - + 17 7 2006 diff --git a/test/writer.jats_publishing b/test/writer.jats_publishing index f7d4a4720..eb3f8faab 100644 --- a/test/writer.jats_publishing +++ b/test/writer.jats_publishing @@ -24,7 +24,7 @@ Anonymous - + 17 7 2006 -- cgit v1.2.3 From fae6a204f1a072d5efe4dff35fd08fbad2071198 Mon Sep 17 00:00:00 2001 From: Salim B Date: Sat, 27 Feb 2021 01:56:04 +0000 Subject: Fix/update URLs and use HTTP**S** where possible (#7122) --- CONTRIBUTING.md | 16 ++++++++-------- COPYING.md | 2 +- COPYRIGHT | 6 +++--- INSTALL.md | 29 ++++++++++++++--------------- MANUAL.txt | 2 +- README.template | 10 +++++----- doc/lua-filters.md | 2 +- man/pandoc.1 | 2 +- man/pandoc.1.after | 2 +- src/Text/Pandoc/Citeproc.hs | 2 +- src/Text/Pandoc/Citeproc/BibTeX.hs | 8 ++++---- src/Text/Pandoc/Readers/Textile.hs | 2 +- src/Text/Pandoc/Writers/Markdown.hs | 2 +- test/txt2tags.t2t | 2 +- trypandoc/index.html | 2 +- windows/Makefile | 2 +- windows/pandoc.wxs | 4 ++-- 17 files changed, 47 insertions(+), 48 deletions(-) (limited to 'doc') diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e87c96694..595fb94ff 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -372,7 +372,7 @@ The code -------- Pandoc has a publicly accessible git repository on -GitHub: . To get a local copy of the source: +GitHub: . To get a local copy of the source: git clone https://github.com/jgm/pandoc.git @@ -382,7 +382,7 @@ the pandoc library is in `src/`, the source for the tests is in The modules `Text.Pandoc.Definition`, `Text.Pandoc.Builder`, and `Text.Pandoc.Generic` are in a separate library `pandoc-types`. The code can -be found in . +be found in . To build pandoc, you will need a working installation of the [Haskell platform]. @@ -445,14 +445,14 @@ you may want to consider submitting a pull request to the [closed issues]: https://github.com/jgm/pandoc/issues?q=is%3Aissue+is%3Aclosed [latest released version]: https://github.com/jgm/pandoc/releases/latest [Nightly builds]: https://github.com/jgm/pandoc/actions?query=workflow%3ANightly -[pandoc-discuss]: http://groups.google.com/group/pandoc-discuss +[pandoc-discuss]: https://groups.google.com/group/pandoc-discuss [issue tracker]: https://github.com/jgm/pandoc/issues -[User's Guide]: http://pandoc.org/MANUAL.html -[FAQs]: http://pandoc.org/faqs.html -[EditorConfig]: http://editorconfig.org/ -[Haskell platform]: http://www.haskell.org/platform/ +[User's Guide]: https://pandoc.org/MANUAL.html +[FAQs]: https://pandoc.org/faqs.html +[EditorConfig]: https://editorconfig.org/ +[Haskell platform]: https://www.haskell.org/platform/ [hlint]: https://hackage.haskell.org/package/hlint -[hsb2hs]: http://hackage.haskell.org/package/hsb2hs +[hsb2hs]: https://hackage.haskell.org/package/hsb2hs [pre-commit hook]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks [GitHub labels]: https://github.com/jgm/pandoc/labels [good first issue]:https://github.com/jgm/pandoc/labels/good%20first%20issue diff --git a/COPYING.md b/COPYING.md index af5153d8f..90ae12017 100644 --- a/COPYING.md +++ b/COPYING.md @@ -357,5 +357,5 @@ into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the [GNU Lesser General Public -License](http://www.gnu.org/licenses/lgpl.html) instead of this +License](https://www.gnu.org/licenses/lgpl.html) instead of this License. \ No newline at end of file diff --git a/COPYRIGHT b/COPYRIGHT index a6e3a897c..9752c555d 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -22,11 +22,11 @@ The GNU General Public License is available in the file COPYING.md in the source distribution. On Debian systems, the complete text of the GPL can be found in `/usr/share/common-licenses/GPL`. -[GPL]: http://www.gnu.org/copyleft/gpl.html +[GPL]: https://www.gnu.org/copyleft/gpl.html Pandoc's complete source code is available from the [Pandoc home page]. -[Pandoc home page]: http://pandoc.org +[Pandoc home page]: https://pandoc.org Pandoc includes some code with different copyrights, or subject to different licenses. The copyright and license statements for these sources are included @@ -176,7 +176,7 @@ Released under the GNU General Public License version 2 or later. ---------------------------------------------------------------------- The dzslides template contains JavaScript and CSS from Paul Rouget's dzslides template. -http://github.com/paulrouget/dzslides +https://github.com/paulrouget/dzslides Released under the Do What the Fuck You Want To Public License. diff --git a/INSTALL.md b/INSTALL.md index 721dc5d66..d23c349c1 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -45,7 +45,7 @@ by downloading [this script][uninstaller] and running it with `perl uninstall-pandoc.pl`. Alternatively, you can install pandoc using -[Homebrew](http://brew.sh): +[Homebrew](https://brew.sh): brew install pandoc @@ -116,7 +116,7 @@ package repositories. For example, on Debian/Ubuntu, you can install it with `apt-get install haskell-platform`. For PDF output, you'll need LaTeX. We recommend installing -[TeX Live](http://www.tug.org/texlive/) via your package +[TeX Live](https://www.tug.org/texlive/) via your package manager. (On Debian/Ubuntu, `apt-get install texlive`.) ## Chrome OS @@ -238,7 +238,7 @@ The easiest way to build pandoc from source is to use [stack][stack]: pandoc --help - [Not sure where `$CABALDIR` is?](http://www.haskell.org/haskellwiki/Cabal-Install#The_cabal-install_configuration_file) + [Not sure where `$CABALDIR` is?](https://wiki.haskell.org/Cabal-Install#The_cabal-install_configuration_file) 5. By default `pandoc` uses the "i;unicode-casemap" method to sort bibliography entries (RFC 5051). If you would like to @@ -383,30 +383,29 @@ To run just the markdown benchmarks: [Arch]: https://www.archlinux.org/packages/community/x86_64/pandoc/ -[Cabal User's Guide]: http://www.haskell.org/cabal/release/latest/doc/users-guide/builders.html#setup-configure-paths +[Cabal User's Guide]: https://cabal.readthedocs.io/ [Debian]: https://packages.debian.org/pandoc [Fedora]: https://apps.fedoraproject.org/packages/pandoc -[FreeBSD ports]: http://www.freshports.org/textproc/hs-pandoc/ -[GHC]: http://www.haskell.org/ghc/ -[GPL]: http://www.gnu.org/copyleft/gpl.html -[Haskell platform]: http://hackage.haskell.org/platform/ -[MacPorts]: http://trac.macports.org/browser/trunk/dports/textproc/pandoc/Portfile +[FreeBSD ports]: https://www.freshports.org/textproc/hs-pandoc/ +[GHC]: https://www.haskell.org/ghc/ +[Haskell platform]: https://hackage.haskell.org/platform/ +[MacPorts]: https://trac.macports.org/browser/trunk/dports/textproc/pandoc/Portfile [MacTeX]: https://tug.org/mactex/ -[BasicTeX]: http://www.tug.org/mactex/morepackages.html +[BasicTeX]: https://www.tug.org/mactex/morepackages.html [LaTeX]: https://www.latex-project.org -[MiKTeX]: http://miktex.org/ +[MiKTeX]: https://miktex.org/ [librsvg]: https://wiki.gnome.org/Projects/LibRsvg [Python]: https://www.python.org -[NetBSD]: http://pkgsrc.se/wip/pandoc +[NetBSD]: https://pkgsrc.se/wip/pandoc [NixOS]: https://nixos.org/nixos/packages.html [Slackware]: https://www.slackbuilds.org/result/?search=pandoc&sv= [Ubuntu]: https://packages.ubuntu.com/pandoc [download page]: https://github.com/jgm/pandoc/releases/latest -[gentoo]: http://packages.gentoo.org/package/app-text/pandoc +[gentoo]: https://packages.gentoo.org/package/app-text/pandoc [haskell repository]: https://wiki.archlinux.org/index.php/Haskell_Package_Guidelines#.5Bhaskell.5D [openSUSE]: https://software.opensuse.org/package/pandoc -[source tarball]: http://hackage.haskell.org/package/pandoc +[source tarball]: https://hackage.haskell.org/package/pandoc [stack]: https://docs.haskellstack.org/en/stable/install_and_upgrade.html -[cabal-install]: http://hackage.haskell.org/package/cabal-install +[cabal-install]: https://hackage.haskell.org/package/cabal-install [Void]: https://voidlinux.org/ [uninstaller]: https://raw.githubusercontent.com/jgm/pandoc/master/macos/uninstall-pandoc.pl diff --git a/MANUAL.txt b/MANUAL.txt index ba031bcb2..a9465b20c 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -486,7 +486,7 @@ header when requesting a document from a URL: [Emacs Org mode]: https://orgmode.org [AsciiDoc]: https://www.methods.co.nz/asciidoc/ [AsciiDoctor]: https://asciidoctor.org/ -[DZSlides]: http://paulrouget.com/dzslides/ +[DZSlides]: https://paulrouget.com/dzslides/ [Word docx]: https://en.wikipedia.org/wiki/Office_Open_XML [PDF]: https://www.adobe.com/pdf/ [reveal.js]: https://revealjs.com/ diff --git a/README.template b/README.template index 53d14b584..4b469f22b 100644 --- a/README.template +++ b/README.template @@ -7,9 +7,9 @@ Pandoc ====== [![github release](https://img.shields.io/github/release/jgm/pandoc.svg?label=current+release)](https://github.com/jgm/pandoc/releases) -[![hackage release](https://img.shields.io/hackage/v/pandoc.svg?label=hackage)](http://hackage.haskell.org/package/pandoc) -[![homebrew](https://img.shields.io/homebrew/v/pandoc.svg)](http://brewformulas.org/Pandoc) -[![stackage LTS package](http://stackage.org/package/pandoc/badge/lts)](http://stackage.org/lts/package/pandoc) +[![hackage release](https://img.shields.io/hackage/v/pandoc.svg?label=hackage)](https://hackage.haskell.org/package/pandoc) +[![homebrew](https://img.shields.io/homebrew/v/pandoc.svg)](https://formulae.brew.sh/formula/pandoc) +[![stackage LTS package](https://stackage.org/package/pandoc/badge/lts)](https://www.stackage.org/lts/package/pandoc-types) [![CI tests](https://github.com/jgm/pandoc/workflows/CI%20tests/badge.svg)](https://github.com/jgm/pandoc/actions) [![license](https://img.shields.io/badge/license-GPLv2+-lightgray.svg)](https://www.gnu.org/licenses/gpl.html) [![pandoc-discuss on google groups](https://img.shields.io/badge/pandoc-discuss-red.svg?style=social)](https://groups.google.com/forum/#!forum/pandoc-discuss) @@ -85,5 +85,5 @@ License [GPL], version 2 or greater. This software carries no warranty of any kind. (See COPYRIGHT for full copyright and warranty notices.) -[GPL]: http://www.gnu.org/copyleft/gpl.html "GNU General Public License" -[Haskell]: http://haskell.org +[GPL]: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html "GNU General Public License" +[Haskell]: https://haskell.org diff --git a/doc/lua-filters.md b/doc/lua-filters.md index a99dc9008..df55dc44e 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -3478,7 +3478,7 @@ Contract a filename, based on a relative path. Note that the resulting path will usually not introduce `..` paths, as the presence of symlinks means `../b` may not reach `a/b` if it starts from `a/c`. For a worked example see [this blog -post](http://neilmitchell.blogspot.co.uk/2015/10/filepaths-are-subtle-symlinks-are-hard.html). +post](https://neilmitchell.blogspot.co.uk/2015/10/filepaths-are-subtle-symlinks-are-hard.html). Set `unsafe` to a truthy value to a allow `..` in paths. diff --git a/man/pandoc.1 b/man/pandoc.1 index 491e24278..bcda05489 100644 --- a/man/pandoc.1 +++ b/man/pandoc.1 @@ -7495,4 +7495,4 @@ This software carries no warranty of any kind. of contributors, see the file AUTHORS.md in the pandoc source code. .PP The Pandoc source code and all documentation may be downloaded -from . +from . diff --git a/man/pandoc.1.after b/man/pandoc.1.after index e5eabb670..7cd7a93f0 100644 --- a/man/pandoc.1.after +++ b/man/pandoc.1.after @@ -1,3 +1,3 @@ .PP The Pandoc source code and all documentation may be downloaded -from . +from . diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 6658c8c0c..38e992ba1 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -544,7 +544,7 @@ linkifyVariables ref = fixShortDOI x = let x' = extractText x in if "10/" `T.isPrefixOf` x' then TextVal $ T.drop 3 x' - -- see http://shortdoi.org + -- see https://shortdoi.org else TextVal x' tolink pref x = let x' = extractText x x'' = if "://" `T.isInfixOf` x' diff --git a/src/Text/Pandoc/Citeproc/BibTeX.hs b/src/Text/Pandoc/Citeproc/BibTeX.hs index 416fe439e..c0752dadc 100644 --- a/src/Text/Pandoc/Citeproc/BibTeX.hs +++ b/src/Text/Pandoc/Citeproc/BibTeX.hs @@ -577,10 +577,10 @@ itemToReference locale variant item = do eprint <- getRawField "eprint" let baseUrl = case T.toLower etype of - "arxiv" -> "http://arxiv.org/abs/" - "jstor" -> "http://www.jstor.org/stable/" - "pubmed" -> "http://www.ncbi.nlm.nih.gov/pubmed/" - "googlebooks" -> "http://books.google.com?id=" + "arxiv" -> "https://arxiv.org/abs/" + "jstor" -> "https://www.jstor.org/stable/" + "pubmed" -> "https://www.ncbi.nlm.nih.gov/pubmed/" + "googlebooks" -> "https://books.google.com?id=" _ -> "" if T.null baseUrl then mzero diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs index 4991c6308..860da2dc3 100644 --- a/src/Text/Pandoc/Readers/Textile.hs +++ b/src/Text/Pandoc/Readers/Textile.hs @@ -11,7 +11,7 @@ Portability : portable Conversion from Textile to 'Pandoc' document, based on the spec -available at http://redcloth.org/textile. +available at https://www.promptworks.com/textile/. Implemented and parsed: - Paragraphs diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 898905603..d33246a63 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -14,7 +14,7 @@ Conversion of 'Pandoc' documents to markdown-formatted plain text. -Markdown: +Markdown: -} module Text.Pandoc.Writers.Markdown ( writeMarkdown, diff --git a/test/txt2tags.t2t b/test/txt2tags.t2t index f736cfa93..b636c1511 100644 --- a/test/txt2tags.t2t +++ b/test/txt2tags.t2t @@ -270,7 +270,7 @@ FTP.DOMAIN.COM [img.png] %%% Syntax: Image pointing to a link: [[img] link] -[[img.png] http://txt2tags.org] +[[img.png] https://txt2tags.org] %%% Align: Image position is preserved when inside paragraph [img.png] Image at the line beginning. diff --git a/trypandoc/index.html b/trypandoc/index.html index 792f522eb..5761153c9 100644 --- a/trypandoc/index.html +++ b/trypandoc/index.html @@ -14,7 +14,7 @@