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

[FEATURE]: Convert Arrowhead text formatting tags to standard HTML tags. #55

Open
TheWizardofGauze opened this issue Apr 9, 2024 · 4 comments
Labels
feature request This issue requests a feature that doesn't exist (yet) good first issue Good for newcomers mapping This issue or it's solution is related to how information is mapped

Comments

@TheWizardofGauze
Copy link
Contributor

What problem does it solve

Arrowhead uses seemingly arbitrary text formatting system that isn't compatible with most (if any) applications.

What is the solution

Convert Arrowhead's formatting tags from their endpoint to standard HTML tags.

Existing alternatives

Manually converting tags in each application.

Added value

Would simplify text formatting for applications using the API, rather than having to convert the tags each time.

Additional notes

Although I'm unsure how exactly they use their tags, for the dispatches the headline is tagged with <i=3></i> which seems to be either a bold or header tag, while <i=1></i> makes text bold and yellow colored. Not sure the best way to interpret and convert them.

I have yet to see what <i=2></i> does if it exists.

@TheWizardofGauze TheWizardofGauze added the feature request This issue requests a feature that doesn't exist (yet) label Apr 9, 2024
@stnokott
Copy link
Contributor

stnokott commented Apr 9, 2024

Not sure the best way to interpret and convert them

Agreed. That's why I think we should not convert them to other tags.
I would argue for either stripping them or keeping them.

If it is decided to keep them, clients can decide for themselves how to deal with the tags, depending on their usecase.

This is simple string processing and has nothing to do with the API directly, so in my eyes, your suggestion should not be scope of this repository, but rather of clients using it.

@dealloc
Copy link
Member

dealloc commented Apr 10, 2024

I wouldn't necessarily strip them as we'd 'lose' data that way.
However, I don't think that transforming them into HTML would be out of scope for V1, if people want to fetch the original message they can always look to the raw endpoints.

As a compromise, instead of compiling it to <b> tags etc we could have a conversion like this:
<i=3> => <span class="3">
this way the clients can choose how they handle styling (if at all)

@dealloc dealloc added good first issue Good for newcomers mapping This issue or it's solution is related to how information is mapped labels Apr 12, 2024
@DetKewlDog
Copy link

Ladies and gentlemen. I present to you: HDML - Helldivers Markup Language.
Gonna compile everything I know about HDML here:

These are the tags that have previously been used by AHG thus far:
<i=1>lorem ipsum</i> - yellow text
<i=3>lorem ipsum</i> - bold text
image

Besides that, I've come across a few other tags that we are yet to see while looking through the subtitle dump posted by Chats

I've found this line which makes me suspect that <i=2></i> sets the text's color to the automaton's red color.
image
Select a Sector to do <i=1>Missions</i> in, either against the <i=2>Automaton legion</i> or the <i=3>Terminid swarm</i>

I've also found a tag with this syntax: <f=X>lorem ipsum</f>. Though I am yet to figure out what it actually does.
image
image

And lastly, theres the <c=#DEADBEEF>my awesome text</i> tag, which I highly suspect of being used to apply RGBA color to text.
image
image

When I added support for HDML in Helldivers Companion, I just replaced <i=1> with <span class="text-yellow">, <i=3> with <span class="font-bold"> and </i> with </span>.

Hope this helps :)

@DetKewlDog
Copy link

Actually, looking back, i don't think <i=2></i> is red. In the screenshot I attached earlier, <i=3> is used for the Terminids, so it would be very odd for the Automatons to be red and for the Terminids to just be, well, bold.
image
My solution - either somehow tamper with the API responses returned by the API to include these tags that we're missing, or just play the waiting game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request This issue requests a feature that doesn't exist (yet) good first issue Good for newcomers mapping This issue or it's solution is related to how information is mapped
Projects
None yet
Development

No branches or pull requests

4 participants