Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting some options from the editor #202

Open
Oblomov opened this issue Apr 30, 2022 · 4 comments · May be fixed by #203
Open

Allow setting some options from the editor #202

Oblomov opened this issue Apr 30, 2022 · 4 comments · May be fixed by #203

Comments

@Oblomov
Copy link
Contributor

Oblomov commented Apr 30, 2022

I understand that this may be overengineering the thing a bit, but I thought that it would be nice to have the possibility to set some things such as the spoiler text or language from the editor. This could be supported e.g. with some meta comment keywords. An example:

#media: image.jpg
#description: A fanciful image
#spoiler: Shocking(ly beautiful) image!
#language: eng
Actual text of the toot here
@Oblomov Oblomov linked a pull request Apr 30, 2022 that will close this issue
@kirschner
Copy link

I also tried to find a way to include --media and --description inside of "toot post --editor vim", but it seems this is not supported. A solution like the above one would be really handy.

@Oblomov
Copy link
Contributor Author

Oblomov commented Dec 2, 2022

OK, my original patch to implement this won't work with the new template for posts, so before I make a new design, I think it would be useful to discuss how we want this metadata to be added. I had a patchset that even went as far as allowing writing a whole thread to be posted, with per-message metadata, so the question is: how do we want to syntax to be now?

@ihabunek
Copy link
Owner

ihabunek commented Dec 6, 2022

Sorry for messing up your patch. What do you think about treating the region below the divider as markup?

We could change the editor template to comment out the instructions:

------------------------ >8 ------------------------
# Do not modify or remove the line above. Enter your toot above it.
# Below you may enter options for `toot post` in TOML, e.g.
# visibility = "private"
# sensitive = True

The reason I suggest TOML over e.g. YAML is that I already plan to use tomlkit for user settings file. Also it's a better markup language IMO.

@Oblomov
Copy link
Contributor Author

Oblomov commented Dec 6, 2022

Don't worry about breaking my patch, it was mostly just a proof of concept and I had to change it again whn I I tried introducing multi-post writing, an then I couldn't find a nice way to handle per-post vs per-thread metadata without going super-verbose, which I didn't like either.

TOML would work too instead of YAML, but whichever approach we use, I would like it to be extensible to thread posting with both per-thread and per-post attributes, although I'm not sure what the ideal syntax would be in this case. I'll open a separate issue for the thread posting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants