GitHub 上一个「满分作文生成器」这两天又火了…
该工具通过将专业术语与名人名言以随机的方式填入模板,生成一篇只有 “聪明人” 才能看懂的满分作文!
作文模板来 2020 浙江省高考语文满分作文,大家可自行体验下 [吃瓜]
在线体验: 网页链接 http://t.cn/A6U6P8dZ GitHub: 网页链接 http://t.cn/A6UxhodQ
https://weibo.com/5722964389/Jfsq1rIbe
经过两天折腾终于把坑踩完了。实现方案:Kramdown 转换 Markdown + Rouge 渲染代码高亮 + images.weserv.nl 代理外部图片。
可以在这条嘟文查看本站 Markdown 效果: Markdown指南,本站用户可以直接在网页端看到效果,外站用户请到本站网页上查看,暂不清楚第三方 APP 兼容性。
本站代码已开源, mashirozx/mastodon,可以无缝和官方最新版对接,没有对数据库结构做过任何改动!Docker 镜像在此,请使用 alpha
版本: Docker Hub
Markdown 是一种轻量级标记语言,创始人为约翰·格鲁伯(John Gruber)。它允许人们“使用易读易写的纯文本格式编写文档,然后转换成有效的 XHTML(或者 HTML)文档”。这种语言吸收了很多在电子邮件中已有的纯文本标记的特性。
它的优点:
Markdown 的中文使用说明见:Markdown 入门参考
本站使用的是 Kramdown 转换器,其实还能实现更多 Markdown 标准之外的特性,比如自定义插图样式:
Here is an inline ![smiley](smiley.png){:height="36px" width="36px"}.
And here is a referenced ![smile]
[smile]: smile.png
{: height="36px" width="36px"}
Here is an inline Media: smiley.
具体见:Kramdown Syntax
目前对图片代理的解决方案还不是特别满意,因为依赖的是第三方的图片代理,希望能用到 Mastodon 自己的 LinkCrawlWorker
和 MediaDownloadedWorker
,但是我太菜了没找到入口。Mastodon 本身有一个 media_proxy
路由,好像可以临时代理图片,也不清楚应该怎么调用?
目前还没有进行严格的测试,包括且不限于 XSS 隐患、外站兼容性、转换器本身稳定性。
在开发过程中,发现 Mastodon 的 Formatter
类(app/lib/formatter.rb
)似乎是实时渲染的,也就是说每访问一次内容都要走一遍渲染流程,这次我的 Markdown parser 正好就是加在这个过程上的,是否会增加服务器负担有待观察,我想如果能直接存进数据库或者有什么方法缓存一下会更合理。
Kramdown 还支持 LaTeX 渲染数学公式,但目前我没有启用,后续会适配这个功能的。
还有如你所见,Markdown 转出来的东西,在网页上样式还不是太完美,等后续慢慢优化,当然,你也可以帮我, CSS 或者 SCSS 样式发给我就可以啦 😁
服务器性能有限,而我目前必须在服务器的 Linux 环境上开发,所以就暂时把生产环境的网站关掉了。运营这个网站并没有盈利的目的,一切出于兴趣和热爱,所以虽然我无法提供服务 100% 稳定(稳定仅指网站的可访问性,网站数据我是每天自动备份的不可能有问题!!)的保证,但是我不会轻易放弃、跑路,否则我为什么要改这么多代码呢?
Now a nested list:
First, get these ingredients:
Boil some water.
Dump everything in the pot and follow
this algorithm:
find wooden spoon
uncover pot
stir
cover pot
balance wooden spoon precariously on pot handle
wait 10 minutes
goto first step (or shut off burner when done)
Do not bump wooden spoon or it will fall.
Notice again how text always lines up on 4-space indents (including
that last line which continues item 3 above).
Here’s a link to a website, to a local
doc, and to a section heading in the current
doc. Here’s a footnote 1.
Tables can look like this:
name | age | blog |
---|---|---|
Nick | 12 | Nick |
Mike | 32 | Mike |
A horizontal rule follows.
Here’s a definition list:
Again, text is indented 4 spaces. (Put a blank line between each
term/definition pair to spread things out more.)
and images can be specified like so:
Inline math equations go in like so: $\omega = d\phi / dt$. Display
math should get its own line and be put in in double-dollarsigns:
And note that you can backslash-escape any punctuation characters
which you wish to be displayed literally, ex.: `foo`, *bar*, etc.
Footnote text goes here. ↩
Paragraphs are separated by a blank line.
2nd paragraph. Italic, bold, and monospace
. Itemized lists
look like:
Note that — not considering the asterisk — the actual text
content starts at 4-columns in.
Block quotes are
written like so.They can span multiple paragraphs,
if you like.
Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., “it’s all
in chapters 12–14”). Three dots … will be converted to an ellipsis.
Unicode is supported. ☺
Here’s a numbered list:
Delimited block for Pandoc to syntax highlight it:
import time
# Quick, count to ten!
for i in range(10):
# (but not *too* quick)
time.sleep(0.5)
print i
Now a nested list:
First, get these ingredients:
Boil some water.
Dump everything in the pot and follow
this algorithm:
find wooden spoon
uncover pot
stir
cover pot
balance wooden spoon precariously on pot handle
wait 10 minutes
goto first step (or shut off burner when done)
Do not bump wooden spoon or it will fall.
Notice again how text always lines up on 4-space indents (including
that last line which continues item 3 above).
Here’s a link to a website, to a local
doc, and to a section heading in the current
doc. Here’s a footnote 1.
Footnote text goes here. ↩
#科技 #36kr 最前线丨郭明錤:若苹果全球下架微信,iPhone出货量或降30% https://36kr.com/p/831635863265921
Nginx 1.19 supports environment variables and templates in Docker | Marco Franssen
https://marcofranssen.nl/nginx-1-19-supports-environment-variables-and-templates-in-docker/
两分钟修改你在本站的头像框:
1、 创建一个 Github 账号,注册教程:https://shouyishe.com/archives/2081
2、打开 https://github.com/mashirozx/hello_robots_txt/blob/master/custom/scss/avatar.scss
3、点击右上角 `Edit this file in your fork of this project` 按键(图一)
4、参照文件上链接里的说明,添加你的配置(图二),编辑好后在页面最后面添加说明并点击绿色按键提交
5、下一个页面上点击绿色按键`Create pull requset` 之后会让编辑 pull request 信息,再次点击 `Create pull requset` 就可以了(图三)
6、最后可以看到你的 pull request 页面(图四),这就提交好了,等管理员稍后同意合并就可以啦,如果长时间没有处理请 @mashiro 提醒一下~
有点厉害哈哈哈
//金正恩罕见亲驾SUV奔赴灾区 朝央视曝车型引关注(图)(含视频)_手机新浪网
https://news.sina.cn/gj/2020-08-08/detail-iivhvpwx9921117.d.html?from=wap
Chinese 🇨🇳 / Dictatorial Admin / Mastodon Code Contributor / 摸鱼技术布道师
Steam: https://steamcommunity.com/id/MashiroBest
Epic: https://store.epicgames.com/en-US/u/d211c824cbd94aaeba898db6bb823ff7
原批交流群:966322309