scribble-frog-helper
1 raco cmd
2 examples
3 procedures
post-url
title
date
tags
meta
essay
8.12

scribble-frog-helper🔗ℹ

Yanying Wang <yanyingwang1@gmail.com>

racket[Scribble] helper functions especially for writing blogs with racket[frog]. Related to:

INDEX:

    1 raco cmd

    2 examples

    3 procedures

1 raco cmd🔗ℹ

Install this package first and then run

$ raco frog/helper -N title

to generate a scribble post with all the functions defined by this lib. This requires the current directory to be a valid Frog or Darwin blog.

The optional the -f/--force flag will force it to proceed regardless of where it is run. Doing so will create the _src/posts/ directory if it does not already exist.

2 examples🔗ℹ

a practical usage within a blog post:
#lang scribble/manual
 
@title{道德经}
@date{-600} @;公元前600年
@tags{哲学 思辨}
 
@essay{
逍遥游
-600-1-18
北冥有鱼,其名为鲲。
鲲之大,不知其几千里也;
化而为鸟,其名为鹏。
鹏之背,不知其几千里也。
}
 
@essay{
马蹄
-600-2-30
马,蹄可以践霜雪,毛可以御风寒,
龁草饮水,翘足而陆,此马之真性也。
虽有义台路寝,无所用之。
}

And I also have a blog post using this lib, you can check that for the html shown result.

3 procedures🔗ℹ

Examples:
> (title "a test post with scribble-frog-helper")

'("Title: " "a test post with scribble-frog-helper")

> (date " 2019-1-1 12:01")

'("Date: " "2019-01-01T12:01:00")

> (tags "tag1 tag2 tag3")

'("Tags: " "tag1, tag2, tag3")

> (essay
  "逍遥游""\n"
  "2019-12-18""\n"
  "北冥有鱼,其名为鲲。""\n"
  "鲲之大,不知其几千里也;""\n"
  "化而为鸟,其名为鹏。""\n"
  "鹏之背,不知其几千里也。")

(list

 (element 'bold (element 'larger '("逍遥游")))

 "\n"

 (element 'smaller '("(" "2019-12-18" ")"))

 (element 'newline '())

 '("北冥有鱼,其名为鲲。" "\n" "鲲之大,不知其几千里也;" "\n" "化而为鸟,其名为鹏。" "\n" "鹏之背,不知其几千里也。"))

procedure

(post-url str)  string?

  str : string?
return a html link of a post of frog website. Example: (post-url "2013-06-19-a-scribble-post")

procedure

(title str)  list?

  str : string?
return list of elements rendered to be: Title: the post title

procedure

(date str)  list?

  str : string?
return list of elements rendered to be: Date: the post date

procedure

(tags str)  list?

  str : string?
return list of elements rendered to be: Tags: tag1 tag2 tag3

procedure

(meta str)  list?

  str : string?
return list of elements with title, date, and tags.

procedure

(essay str)  list?

  str : string?
return an essay for the str.