Changeset 72 in code


Ignore:
Timestamp:
Oct 3, 2023, 2:39:08 AM (20 months ago)
Author:
Izuru Yakumo
Message:

feat: move the blackfriday extension settings out of the render function, improve documentation

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/cmd/aya/main.go

    r71 r72  
    1 // $TheSupernovaDuo: cmd/aya/main.go,v 0.6.3 2023/09/27 22:46:30 yakumo_izuru Exp $
     1// $TheSupernovaDuo: marisa.chaotic.ninja/aya/cmd/aya, v 1.0 2023-10-03 02:34:17, yakumo_izuru Exp $
    22package main
    33
     
    2222)
    2323
     24// Define global constants here
    2425const (
    2526        AYADIR = ".aya"
     
    179180func buildMarkdown(path string, w io.Writer, vars Vars) error {
    180181        v, body, err := getVars(path, vars)
     182        extensions := blackfriday.CommonExtensions|blackfriday.AutoHeadingIDs|blackfriday.Strikethrough|blackfriday.Footnotes
    181183        if err != nil {
    182184                return err
     
    187189        }
    188190        v["content"] = string(blackfriday.Run([]byte(content),
    189                 blackfriday.WithExtensions(blackfriday.CommonExtensions|blackfriday.AutoHeadingIDs|blackfriday.Strikethrough|blackfriday.Footnotes),
     191                blackfriday.WithExtensions(extensions),
    190192        ))
    191193        if w == nil {
     
    303305
    304306// This function passes the files to build to their corresponding functions
     307// As far as I'm aware, Markdown has three possible filename extensions,
     308// but .md is the most common one known.
    305309func build(path string, w io.Writer, vars Vars) error {
    306310        ext := filepath.Ext(path)
     
    318322}
    319323
     324// Build everything and store it on PUBDIR
     325// If boolean watch is true, it keeps on going
     326// every time you modify something.
    320327func buildAll(watch bool) {
    321328        lastModified := time.Unix(0, 0)
     
    392399}
    393400
     401// Main loop
    394402func main() {
    395403        if len(os.Args) == 1 {
  • trunk/doc.go

    r70 r72  
    1 package aya
    21// Package aya is [...]
    32
     
    1817// This one (re)incorporates the features removed in the former from the latter
    1918
     19// Copyright (c) 2014 Serge Zaitsev
     20// Copyright (c) 2023 Izuru Yakumo
     21
    2022// Ayaya~
     23package aya
  • trunk/version.go

    r56 r72  
     1// This is used for setting build-time variables
    12package aya
    23
Note: See TracChangeset for help on using the changeset viewer.