创建链接以使用预填信息启动新主题

这里有很多繁重且对普通人来说难以理解的技术工作;我敢打赌,我们可以创建一个“助手”网页,让人们轻松生成这些链接。

这可能是一个不错的项目,可以供某人实现:

import urllib

site = 'meta.discourse.org'
title = '''My special checklist'''
category = 'todo'
tags = ['tag1', 'tag2']

template = '''\
# Important!

Do these things:

[ ] thing one
[ ] thing two
'''

query = urllib.parse.urlencode(dict(
    title =    title,
    category = category,
    tags =     ','.join(tags),
    body =     template,
))
print(f'https://{site}/new-topic?{query}')

打印 此链接

4 个赞