Knighthana
文章95
标签138
分类7

文章归档

博客维护更新记录

博客维护更新记录

博客维护更新记录

Give up Jekyll

早于2019年5月19日的某个时间,我放弃了使用Jekyll作为博客框架的行动。

之后转为手动维护。

详见放弃jekyll,重建咕客记录

Try Text2html For The First Day

Today I start a new repo named text2html.

Using C programing Language to edit text file is a challangable work, because I'm not used to progress string in the past. The string.h file is a cherish.

strcpy

strcpy function is the function that copy a string to another.

e.g. strcpy(str1, str2) means copy str2 to str1 from the first letter, both of them.

I got to know about that function very long ago, but what a shame that I forgot it. I almost start to use a loop and a if to write a function like this.

strcat and strncat

These functions are the functions which can add the string to another, automaticly deal with the '\0' problem.

e.g. strcat(str1, str2) means add str2 to str1 on the tail, and change the '\0' tag.

struct using

Struct is a great invention. But I didn't use it until now.

Struct helps me to divide the inner struct of the data, and focus on what the data means. I don't need to find out where is the start symbol, where is the end symbol, where to replace the text by using the struct.

Just malloc a place for the struct, and let the annoying things get away.

error: expected ':', ',', ';', '}' or '__attribute__' before '=' token

Struct can't be assignment when initing.

New conception

Make all data on one structure. Use less pointer.

Knighthana @ XDU

2019/05/26

Try Text2html: 一些进展

四年过去了,我逐渐了解到之前的想法,“用C写一个text2html”是个什么工程。

19年的时候,我把这个问题想简单了,随着这几年我学习的内容不断地增加,我了解到,如果想把一种语言的代码转换成另一种语言的代码,需要写一个编译器出来,这种事情听着就头大。

一边学习CPTT这个抽象的东西,我一边在想,用C去完成这种工作,是否有些不太容易?(还有:这样造轮子是不是在浪费时间)

今天得知了一个好消息——在一次github上的搜索中,我发现ruby gems中有一个项目叫作markdown2html,它基本能满足我对将markdown文本转化成为html的需求;生成的文本仅仅是html文本,我可以自行插入头部的标签和尾部标签,需要引用的css也就可以在那边声明

但是获得了更多坏消息:

我之前认为最大的阻力在于转换,或者说把markdown编译为html——虽然说确实如此,如果一行行地手敲<p></p>过去实在是太累了——然而我因此忽略了另外的一些问题,这些阻力也不小;

第一,转换仅仅只是转换,距离把网站搭建起来还差了很多,我需要自动在网页下方加上返回主页的链接,以及需要做一些可能的手动精修;

第二,我需要自动统计文章的日期,需要读取文章下方的Tag,然后根据这些内容每次更新我的index.html文件;不然博客页面显得太乱了;

第三,这东西还是不支持数学公式,我最近对GitHub自带的markdown渲染器感觉到不太爽的地方就是它的数学公式支持太糟糕了,稍微复杂一点的公式就无法渲染了,而且至今其他项目里还有一个简单的公式不知道为什么始终报错无法渲染;

我需要一个什么玩意?

最理想的情况当然是写完markdown,敲一个./run,于是文章就自动从raw/*.md变成post/*.html,这包括语法转换什么的,还要自动插入博客的链接,毕竟我懒得在撰写文章的时候还要考虑自动跳转之类的东西,然后自动更新我的index.html,不仅要加入新的链接,还要更新按日期分类博客、按Tag分类博客的静态页面;

但目前是没有这么便捷的工具的。

头痛,虽然发现这个工具能减轻很多工作,但是更新博客还是变成了一种体力活。

所以我还是不会把所有的*.md转换成*.html,因为这实在是太消耗精力了。

Knighthana

2023/04/05

应该是最后一次更新这篇文章了

目前我已经将博客框架迁移到Hexo,它基本满足了我的所有博客方面的需求

此外,所有的博客维护日志都会放在 博客维护专题 里,这样也就可以满足记录更新注释功能的需求了

那就不再需要把大事记到同一个页面里面了

而且迁移博客的时候我发现了pandoc,这是一个非常强大的东西,一个超级的,面向文档类代码语言的编译器

好强啊......

2023/04/20

返回主页