You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.4 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. #let conf(
  2. clong-title: "",
  3. title: "",
  4. author: "Annwan",
  5. date: datetime.today().display(),
  6. main-font: (font: "Andika", stylistic-set: 13),
  7. clong-font: it => text(font: "Charis SIL", it),
  8. doc
  9. ) = {
  10. set text(..main-font)
  11. set par(justify: true)
  12. set heading(numbering: "I.1.1.1")
  13. show heading.where(level: 1): it => {pagebreak(weak: true); align(center, it)}
  14. align(horizon, {
  15. align(center, text(18pt)[*#title*])
  16. if clong-title != "" {
  17. align(center, text(18pt,clong-font([*#clong-title*])))
  18. }
  19. align(center, author)
  20. align(center, date)
  21. })
  22. pagebreak()
  23. outline(
  24. fill: repeat([#h(1em).])
  25. )
  26. pagebreak(weak: true)
  27. set page(
  28. footer: [
  29. #h(1fr)
  30. #context counter(page).get().at(0)
  31. #h(1fr)
  32. ]
  33. )
  34. counter(page).update(1)
  35. doc
  36. }
  37. #let dict(
  38. data: (),
  39. key: it => it.at("w"),
  40. wformat: it => [*#it*],
  41. debug: false
  42. ) = {
  43. [= Dictionary]
  44. if debug [#context data.len()] else {}
  45. v(3em)
  46. columns(2, {
  47. let sorted_data = data.sorted(key: key)
  48. for word in sorted_data {
  49. if word.keys().any(it => it == "r") [
  50. #wformat(word.at("w")) /#word.at("i")/ → #wformat(word.at("r")) \
  51. ]
  52. else [
  53. #wformat(word.at("w")) /#word.at("i")/ _#word.at("p")_ #eval(word.at("n"), mode: "markup") \
  54. ]
  55. }
  56. })
  57. }