summaryrefslogtreecommitdiff
path: root/html
diff options
context:
space:
mode:
Diffstat (limited to 'html')
-rw-r--r--html/research/talks.nix144
-rw-r--r--html/research/writings.nix161
2 files changed, 160 insertions, 145 deletions
diff --git a/html/research/talks.nix b/html/research/talks.nix
index 9e1fd56..a68e9f3 100644
--- a/html/research/talks.nix
+++ b/html/research/talks.nix
@@ -3,79 +3,81 @@
data,
lib,
...
-}: let
- matchFirst = regexp: str: let
- results = builtins.match regexp str;
- in
- if results == null
- then null
- else builtins.head results;
- join = url: name: with html; lib.optionalString (url != null) " · ${href url "${icon "las la-paperclip"} ${name}"}";
- talks = data.publications.talks;
+}:
+let
+ matchFirst =
+ regexp: str:
+ let
+ results = builtins.match regexp str;
+ in
+ if results == null then null else builtins.head results;
+ join =
+ url: name:
+ with html;
+ lib.optionalString (url != null) " · ${href url "${icon "las la-paperclip"} ${name}"}";
+ talks = data.research.talks;
in
- with html;
- dl (for (sort.reverse.byPath ["issued" "date-parts"] talks) (item:
- with item; let
- date-parts = builtins.head issued.date-parts;
- date = {
- year = builtins.elemAt date-parts 0;
- month = builtins.elemAt date-parts 1;
- day = builtins.elemAt date-parts 2;
- };
- extra =
- if item ? note
- then note
- else "";
- abstractURL = matchFirst ".*abstract: ([^\n ]*).*" extra;
- slidesURL = matchFirst ".*slides: ([^\n ]*).*" extra;
+with html;
+dl (
+ for (sort.reverse.byPath [ "issued" "date-parts" ] talks) (
+ item:
+ with item;
+ let
+ date-parts = builtins.head issued.date-parts;
+ date = {
+ year = builtins.elemAt date-parts 0;
+ month = builtins.elemAt date-parts 1;
+ day = builtins.elemAt date-parts 2;
+ };
+ extra = if item ? note then note else "";
+ abstractURL = matchFirst ".*abstract: ([^\n ]*).*" extra;
+ slidesURL = matchFirst ".*slides: ([^\n ]*).*" extra;
+ # broken because of tabs
+ # paperURL = let
+ # paperId = matchFirst "([A-z0-9]*[0-9]{4})[a-z]" id;
+ # in
+ # if paperId == null
+ # then null
+ # else "#Writings#${paperId}";
+ in
+ [
+ (dt [
+ ((if abstractURL == null then (x: x) else href abstractURL) (em title))
+ ])
+ (dd [
+ (with (makeDate date); tag pretty)
+ "@ ${href url event-title}, ${publisher-place}"
+ (join slidesURL "slides")
# broken because of tabs
- # paperURL = let
- # paperId = matchFirst "([A-z0-9]*[0-9]{4})[a-z]" id;
- # in
- # if paperId == null
- # then null
- # else "#Writings#${paperId}";
- in [
- (dt [
- ((
- if abstractURL == null
- then (x: x)
- else href abstractURL
- ) (em title))
- ])
- (dd [
- (with (makeDate date); tag pretty)
- "@ ${href url event-title}, ${publisher-place}"
- (join slidesURL "slides")
- # broken because of tabs
- # (join paperURL "paper")
- (details [
- (summary "More")
- (
- dl (
- lib.optionals (item ? abstract) [
- (dt "Abstract.")
- (dd (blockquote abstract))
- ]
- ++ [
- (dt "Cite.")
- (let
- citeWith = title: type:
- details [
- (summary title)
- (pre (code (
- lib.readFile "${data.publications.files}/${type}/${id}"
- )))
- ];
- in
- dd [
- (citeWith "BibLaTeX" "biblatex")
- (citeWith "BibTeX" "bibtex")
- (citeWith "CSL JSON" "csljson")
- ])
+ # (join paperURL "paper")
+ (details [
+ (summary "More")
+ (dl (
+ lib.optionals (item ? abstract) [
+ (dt "Abstract.")
+ (dd (blockquote abstract))
+ ]
+ ++ [
+ (dt "Cite.")
+ (
+ let
+ citeWith =
+ title: type:
+ details [
+ (summary title)
+ (pre (code (lib.readFile "${data.research.files}/${type}/${id}")))
+ ];
+ in
+ dd [
+ (citeWith "BibLaTeX" "biblatex")
+ (citeWith "BibTeX" "bibtex")
+ (citeWith "CSL JSON" "csljson")
]
)
- )
- ])
+ ]
+ ))
])
- ]))
+ ])
+ ]
+ )
+)
diff --git a/html/research/writings.nix b/html/research/writings.nix
index 4ba4ec6..205bcf6 100644
--- a/html/research/writings.nix
+++ b/html/research/writings.nix
@@ -3,86 +3,99 @@
data,
lib,
...
-}: let
- attrValsOpt = attrs: attrSet:
- lib.attrVals (builtins.filter (attr: lib.hasAttr attr attrSet) attrs)
- attrSet;
- concatStringsPrefix = prefix: strings:
- lib.concatStrings (builtins.map (string: prefix + string) strings);
- concatStringsSuffix = suffix: strings:
- lib.concatStrings (builtins.map (string: string + suffix) strings);
- format = publication:
+}:
+let
+ attrValsOpt =
+ attrs: attrSet: lib.attrVals (builtins.filter (attr: lib.hasAttr attr attrSet) attrs) attrSet;
+ concatStringsPrefix =
+ prefix: strings: lib.concatStrings (builtins.map (string: prefix + string) strings);
+ concatStringsSuffix =
+ suffix: strings: lib.concatStrings (builtins.map (string: string + suffix) strings);
+ format =
+ publication:
with html;
with publication;
- {
- inherit id title url year abstract cite;
- }
- // (let
- authorsOther =
- lib.remove "${data.basics.name.first} ${data.basics.name.last}"
- (builtins.map (author: "${author.given} ${author.family}") author);
+ {
+ inherit
+ id
+ title
+ url
+ year
+ abstract
+ cite
+ ;
+ }
+ // (
+ let
+ authorsOther = lib.remove "${data.basics.name.first} ${data.basics.name.last}" (
+ builtins.map (author: "${author.given} ${author.family}") author
+ );
in
- lib.optionalAttrs (authorsOther != []) {
- authors = "With ${lib.concatStringsSep ", " authorsOther}";
- })
- // lib.optionalAttrs (publication ? note) {
- note = publication.note;
- }
- // lib.optionalAttrs (publication ? container-title) {
- published =
- "In ${em container-title}"
- + concatStringsPrefix ", "
- (attrValsOpt ["volume" "issue" "publisher"] publication);
+ lib.optionalAttrs (authorsOther != [ ]) {
+ authors = "With ${lib.concatStringsSep ", " authorsOther}";
}
- // lib.optionalAttrs (publication ? event-title) {
- published = "At ${em event-title}";
- }
- // lib.optionalAttrs (publication ? DOI) {
- doi = "${small "DOI"}: ${href "https://doi.org/${DOI}" (code DOI)}";
- };
- listPublications = collection:
+ )
+ // lib.optionalAttrs (publication ? note) {
+ note = publication.note;
+ }
+ // lib.optionalAttrs (publication ? container-title) {
+ published =
+ "In ${em container-title}"
+ + concatStringsPrefix ", " (attrValsOpt [ "volume" "issue" "publisher" ] publication);
+ }
+ // lib.optionalAttrs (publication ? event-title) {
+ published = "At ${em event-title}";
+ }
+ // lib.optionalAttrs (publication ? DOI) {
+ doi = "${small "DOI"}: ${href "https://doi.org/${DOI}" (code DOI)}";
+ };
+ listResearch =
+ collection:
with html;
- section [
- (dl (for (sort.reverse.byPath ["issued" "date-parts"] collection)
- (publication: let
+ section [
+ (dl (
+ for (sort.reverse.byPath [ "issued" "date-parts" ] collection) (
+ publication:
+ let
formatted = format publication;
in
- with formatted;
- lines [
- (dt {id = "Writings#${id}";}
- "${href {target = "_blank";} url (em title)} (${year})")
- (dd [
- (concatStringsSuffix ". "
- (attrValsOpt ["authors" "note" "published" "doi"]
- formatted))
- (details [
- (summary "More")
- (dl [
- (dt "Abstract.")
- (dd (blockquote abstract))
- (dt "Cite.")
- (let
- citeWith = title: type:
- details [
- (summary title)
- (pre (code (
- lib.readFile "${data.publications.files}/${type}/${id}"
- )))
- ];
- in
- dd [
- (citeWith "BibLaTeX" "biblatex")
- (citeWith "BibTeX" "bibtex")
- (citeWith "CSL JSON" "csljson")
- ])
- ])
- ])
+ with formatted;
+ lines [
+ (dt { id = "Writings#${id}"; } "${href { target = "_blank"; } url (em title)} (${year})")
+ (dd [
+ (concatStringsSuffix ". " (attrValsOpt [ "authors" "note" "published" "doi" ] formatted))
+ (details [
+ (summary "More")
+ (dl [
+ (dt "Abstract.")
+ (dd (blockquote abstract))
+ (dt "Cite.")
+ (
+ let
+ citeWith =
+ title: type:
+ details [
+ (summary title)
+ (pre (code (lib.readFile "${data.research.files}/${type}/${id}")))
+ ];
+ in
+ dd [
+ (citeWith "BibLaTeX" "biblatex")
+ (citeWith "BibTeX" "bibtex")
+ (citeWith "CSL JSON" "csljson")
+ ]
+ )
])
- ])))
- ];
-in {
- conferences = listPublications data.publications.conferences;
- journals = listPublications data.publications.journals;
- misc = listPublications data.publications.misc;
- reports = listPublications data.publications.reports;
+ ])
+ ])
+ ]
+ )
+ ))
+ ];
+in
+{
+ conferences = listResearch data.research.conferences;
+ journals = listResearch data.research.journals;
+ misc = listResearch data.research.misc;
+ reports = listResearch data.research.reports;
}