Creating a link to start a new topic with pre-filled information

There is a LOT of technical heavy lifting happening here that makes this a little unacceptable to mortals; I bet we could make a “helper” webpage that allowed people to generate these links easily.

The equivalent of this might be a nifty little project for someone to implement:

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}')

prints this link

4 Likes