Discord-to-Cohost compiler written in Rust using Tera

Related tags

Command-line Cohoard
Overview

Cohoard - Post formatted chatlogs to Cohost!

Cohoard is a tool for turning chatlogs into formatted posts on Cohost. You can use Cohoard to easily format your silly conversations like a Discord channel, an MSPA chatlog, and so on.

Discord Template

Currently the only option available is the Discord template, which stylizes conversation as Discord chatlogs.

@ Today at 4:13 PM
AARON: you can write messages in play-script style
AARON: each line is considered it's own "message"
AARON: by default, messages are collapsed together, and the avatar + username only shows up once
@
AARON: however, the @ symbol, when used by itself on a newline, will break up a sequence of messages and force the avatar + username to display again.
@ Tomorrow at 6:12 AM
AARON: you can also use the @ symbol to set the timestamp of the message. This will also make the avatar + username show up again.
AARON: the timestamp text is freeform--feel free to write any time you like.
CASSIE: Also, other people can be mixed into the chat log seemlessly.
CASSIE: Finally, if you have a multi-line message
(That is to say, a single message that itself contains newlines),
you can simply write those out on their own line, with the "USERNAME:" header at the start.
Note that multi-line messages are rendered slightly closer together than seperate messages.
CASSIE: For example
CASSIE: these are farther apart
CASSIE: since these are seperate messages
CASSIE: While these lines
are closer together
since they're in the same message.
AARON: oh yeah! you can also *use normal markdown* ~~like you do in discord~~ **and it should hopefully just work**
CASSIE: (Right now, <u>Discord-style underlines</u> don't quite work yet, but you can use normal HTML tags instead.)
CASSIE: (The above line is written as `<u>underlines</u>`.)

This produces the following result:

The rendered result of the above chatlog, which is stylized as a Discord conversation

Comments
  • Feature request: user reference styling

    Feature request: user reference styling

    being able to reffer to other users inline with a simular replacement system to the markup system. probably with @{USER_KEY}.{field} or some other character to identify it in a message or timestamp. which acts as a shorthand for styled span with the text of the field being insterted.

    example use: adding timestamps/ day breaks to MPSA style chatlogs since those often have "{handle} [{shorthandle}] started pestering {handle} [{shorthandle}]"

    which would probably look like this in practice @-- @JADE.handle [@Jade.short_handle] started pestering @DAVE.handle [@DAVE.short_handle]

    we were seperately going to make a feature request for adding timestamps to the mspa template but that would probably be reduntant as that would likely be the test case for this.

    hard part really is exposing it to terra in a way that let's templates configure the way this system works. maybe they're stored in Postblock as a struct which holds: user mentioned, field, and timestamp/message context or something, wdk? also allows for adding mentions to the discord template.

    enhancement template rust 
    opened by AurySystem 3
  • Line breaks in Twitter template break formatting

    Line breaks in Twitter template break formatting

    I'm currently working on making a post using Cohoard, and I've found that the Twitter template includes line breaks in between the <span> for the display name and the <span> for the handle that seemingly mess up Cohost's Markdown parsing. It renders fine in Cohoard, but bringing it over to Cohost breaks it for some reason: Capto_Capture 2022-10-28_04-28-37_PM I'm afraid I can't really figure out more of what's causing this on my own, but removing the line breaks seems to fix it so that looks like the best option for the template.

    opened by LemmaEOF 3
  • Feature request: MSPA template supporting different name color from text color

    Feature request: MSPA template supporting different name color from text color

    in Godfeels, June Eg8ert's headmates Dare and Risk have different text colors from their name colors. Dare's name color is #7882ff and Risk's is #3e9fd1, while Dare's text color is #0715cd and Risk's is #005682. is there a way to support that in Cohoard? — alphy

    opened by pleonasticTautology 2
  • adding heavier font weight to discord user names to more mimic discord appearance

    adding heavier font weight to discord user names to more mimic discord appearance

    i upped the font weight to 600 so that it looks bold like in discord

    also i figured i could do it myself and open a pull request because it's CSS-y stuff, rather than ask you to do it

    this is also my first pull request soooo i hope i did it right

    opened by pleonasticTautology 1
  • Add link to cohoard and cohost to readme

    Add link to cohoard and cohost to readme

    Problem

    The README should link to the actual published Cohoard site, so that people who look at the repo can go and try it out!

    Solution

    We add a link to Cohoard at the top of the README. We add a link to Cohost as well!

    opened by eashwar 1
  • Add a

    Add a "use local files" toggle for the website.

    Currently the website is hard to develop locally with because it uses lots of files hosted on other severs. The following need to be able to use a local version of the file:

    • Templates
    • The wasm-bind generated Cohoard package
    enhancement 
    opened by a2aaron 1
  • Improvement: Table-style config UI

    Improvement: Table-style config UI

    • [x] Create table-style config.
    • [x] Make table persistent between reloads.
    • [x] Make row placeholder text change when row header is updated.
    • [x] Highlight the table to show why a Tera template errors out.
    website 
    opened by a2aaron 1
  • Enhancement: Add a Github Actions to make easier to deploy updates to the site.

    Enhancement: Add a Github Actions to make easier to deploy updates to the site.

    The github actions should let me deploy a new version of the Cohoard WASM library. This will need to do the following things:

    1. Check out the repo
    2. Run the following commands in the wasm sub-crate
    wasm-pack build --target web --release
    wasm-pack pack
    

    (this might need to install cargo along with wasm-pack first) 3. Upload the files cohoard.js and cohoard_bg.wasm to the Spaces CDN that Cassie is using, with an appropriate semver version name (or possibly to just a "latest" folder?).

    opened by a2aaron 0
  • Enhancement: Add preset images for people to use.

    Enhancement: Add preset images for people to use.

    Hosting some images on cassie's site would be useful for people to use. Good options include the Discord and Twitter default profile pictures, an all black/white/transparent image, and Undertale images.

    enhancement 
    opened by a2aaron 0
  • Feature: Add person presets.

    Feature: Add person presets.

    It would be nice to have a way to add a person with a set of reasonable preset values. Some good examples are Undertale, Homestuck, and 17776 characters.

    enhancement 
    opened by a2aaron 0
  • Attempt to give better error reporting in the UI.

    Attempt to give better error reporting in the UI.

    Currently, this just tries to parse "missing variable" messages from Tera. This is very hacky and brittle, and would be better done if Tera could report rendering errors more richly. Some other things that aren't great are:

    We highlight the entire column, when we should try to pinpoint the
    specific row that caused the error.
    Im not really sure what to do if the script uses a key that isn't in the
    config table. This is annoying to detect but could feasibly be done.
    

    Must be merged with https://github.com/a2aaron/Cohoard/pull/27

    Would complete one task in https://github.com/a2aaron/Cohoard/issues/9

    opened by a2aaron 0
  • Enhancement: Find a better Discord font.

    Enhancement: Find a better Discord font.

    Discord itself seems to use a font weight of 500 for usernames (normal text is 400, and bold text is 700). However, lots of fonts don't have more than two font weights, so there isn't anyway to make the username bold without it being just as bold as normal bold text.

    The Discord template uses the following font family: Whitney, Verdana, Helvetica Neue, Helvetica, Arial, sans-serif, falling back to the first one in that list. In practice, almost everyone probably sees Verdana, since most people don't have Whitney installed. Helvetica Neue does have 6 weights (100 thru 600) but it seems like it's not a default font on Windows machines (which means we probably can't rely on it). The rest only have two font weights.

    Below are some comparisons of how a post might look in different fonts:

    Cohoard, actual font: Verdana, font weight 600 image

    Cohoard, actual font: Helvetica Neue, font weight 600 image

    Cohoard, actual font: Helvetica Neue, font weight 500 (imo this looks the closest to actual Discord) image

    Cohoard, actual font: Helvetica, font weight 600 image

    Cohoard, actual font: Arial, font weight 600 image

    Discord, actual font: gg sans, font weight 500 (i think?) image

    opened by a2aaron 2
  • Enhancement: Allow templates to declare what variables they use.

    Enhancement: Allow templates to declare what variables they use.

    It would be nice if a template could specify what variables they use in the Config table and what kind of variables those are. This could go in a config block and would specify the name + type of variable. We could use this information to do things like only display the columns relevant to a template or display some inputs using a color selector or checkbox or similar.

    enhancement template website 
    opened by a2aaron 0
  • Improvement(?): Write our own inline/Discord markdown parser.

    Improvement(?): Write our own inline/Discord markdown parser.

    Right now, we have to fight pulldown_cmark on a bunch of stuff, because it's trying to do a bunch of stuff for parsing Markdown. This includes

    • eating newlines
    • adding <p> tags to messages
    • using <pre> and <code> instead of a <span> that we can style
    • not handling underline

    This is annoying and suggests that we might be better off writing our own markdown parser. This doesn't need to implement the whole Markdown spec, but instead just the inline formatting stuff (and probably doesn't even need to be super good at it's job, so long as it can get most of the cases). This would make handling blank newlines much easier as well.

    enhancement rust 
    opened by a2aaron 1
Owner
Aaron Kofsky
gnar
Aaron Kofsky
A PostgreSQL extension for rendering the Tera HTML templating language.

PGTera PGTera is a PostgreSQL extension that provides functions for using Tera to render HTML templates. When used with a tool like Postgrest, you can

Frankie 4 Feb 16, 2024
⚡ Blazing ⚡ fast ⚡ compiler for Cairo, written in 🦀 Rust 🦀

Cairo 1.0 ?? ⚡ Blazing ⚡ fast ⚡ compiler for Cairo, written in ?? Rust ?? Report a Bug - Request a Feature - Ask a Question Getting Started Prerequisi

Darlington Nnam 6 Feb 23, 2023
A discord bot to view & monitor OpenSea collections, written in Rust

Titan What is this This is a discord bot to monitor OpenSea collections and get info about them, including: Floor Price Activity Sales per Hour And mo

theldb 3 Oct 11, 2022
🚀 Discord Rich Presence plugin for Neovim written in Rust

?? Cord ?? Cord is a Discord Rich Presence plugin designed for Neovim, written in Rust. ?? Features Lightweight and dependency-free Cross-platform sup

vyfor 39 May 6, 2024
This rust compiler backend emmits valid CLR IR, enambling you to use Rust in .NET projects

What is rustc_codegen_clr? NOTE: this project is a very early proof-of-concept This is a compiler backend for rustc which targets the .NET platform an

null 252 Sep 7, 2023
Vyper-Compiler Version Manager in Rust

Vyper Compiler Version Manager in Rust Install $ cargo install --git https://github.com/storming0x/vvm-rs --locked vvm-rs Install from source $ git c

Storming0x 26 Dec 15, 2022
🐱 HQ9C is a very serioues compiler for HQ9+, it meta-compiles with Rust.

HQ9+ Compiler HQ9c (Or HQ9+ Compiler) is a blockchain-based NFT minting AI machine-learning cloud infraestructure for the compiling of the great progr

Alex 5 Aug 28, 2022
Nederlandse programmeertaal. Geinterpreteerd en met dynamische types. Met bytecode compiler en virtual machine, in Rust.

Nederlang Nederlang is een geinterpreteerde programmeertaal, in het Nederlands! Met als bestandsnaam extensie.... .nl! Het maakt gebruik van dynamisch

Danny van Kooten 17 Dec 15, 2022
Unborrowed Rust Compiler (rustc without a borrowchecker)

ubrustc: Unborrowed rustc This is rustc with the borrow checker disabled. I wrote it in like, 30 minutes because this tweet made me laugh. Example //

Thom Chiovoloni 57 Apr 20, 2023
A rust library to interact with the Vyper compiler!

vyper-rs A rust library to interact with the Vyper compiler! Dependencies Please ensure that the Vyper compiler is installed and added to PATH! To ins

crypdough.eth 21 Jul 24, 2023
A high-performance Rust library designed to seamlessly integrate with the Discord API.

Rucord - Rust Library for Discord API Interactions Note: This library is currently under development and is not yet recommended for production use. Ov

Coders' Collab 4 Feb 26, 2023
Blaze is a Rust script that continuously monitors server resource usage and sends real-time summaries and alerts to a Discord channel via Webhook.

Blaze Blaze is a Rust script designed to run 24/7 on a server, providing a summary of resource usage every 30 minutes (configurable) to a Discord chan

ShadowArcanist 18 Sep 23, 2024
Tools - The Rome Toolchain. A linter, compiler, bundler, and more for JavaScript, TypeScript, HTML, Markdown, and CSS.

Rome is currently being rewritten in Rust. Read more about it in our latest blog post. The documentation below is out of date and available for poster

Rome 22k Jan 3, 2023
Minimal Pandoc compiler -> HTML

Minimal Pandoc compiler -> HTML

/c/ympfh 1 Apr 6, 2022
Compiler for an "extended" version of the Mindustry logic language

Minblur Compiler Minblur is a compiler for a superset of "logic" programming language in the game Mindustry. It helps reduce code-duplication, making

Binder News 15 May 2, 2022
An awesome language and its compiler.

Calocom Project Build Build with cargo-make Just run cargo make in the root directory of the project. Or, if you want to build it in release mode, run

Aoyang Yu 31 Sep 16, 2022
Open-source compiler for the Papyrus scripting language of Bethesda games.

Open Papyrus Compiler This project is still WORK IN PROGRESS. If you have any feature requests, head over to the Issues tab and describe your needs. Y

erri120 22 Dec 5, 2022
The JavaScript Oxidation Compiler -> Linter / Prettier

The JavaScript Oxidation Compiler (oxc) Why this project? The goal of this project is to: Create a blazingly fast JavaScript Compiler written in Rust.

Boshen 125 Feb 22, 2023
The zkEVM Vyper compiler.

zkSync Era: Vyper Compiler zkSync Era is a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum without compromising on security or decent

Matter Labs 10 Feb 18, 2023