Sublime Forum

ExportHtml Plugin (rename from PrintHtml)

#85

A fairly useless feature I added for fun. You can use filters in ExportHtml and ExportBbcode. I guess this could be useful if you wanted to apply some filter to theme. Then you could use exportHtml to apply the filter and then extract the theme from the HTML via the download option in the toolbar. Anyways, I realize this feature is pretty worthless, but it was fun nonetheless.

You can use the following: invert, grayscale, sepia, brightness, saturation, hue, colorize.

Unaltered:
[pre=#2D2D2D] // BBCODE menu items
“bbcode_panel”:
{
“To Clipboard - Format as BBCode”: {
“numbers”: false,
“multi_select”: true
}
},[/pre]

Invert:
[pre=#D2D2D2] // BBCODE menu items
“bbcode_panel”:
{
“To Clipboard - Format as BBCode”: {
“numbers”: false,
“multi_select”: true,
“filter”: “invert”
}
},[/pre]

grayscale:
[pre=#2D2D2D] // BBCODE menu items
“bbcode_panel”:
{
“To Clipboard - Format as BBCode”: {
“numbers”: false,
“multi_select”: true,
“filter”: “grayscale”
}
},[/pre]

sepia:
[pre=#3C362A] // BBCODE menu items
“bbcode_panel”:
{
“To Clipboard - Format as BBCode”: {
“numbers”: false,
“multi_select”: true,
“filter”: “sepia”
}
},[/pre]

Saturation:
[pre=#2D2D2D] // BBCODE menu items
“bbcode_panel”:
{
“To Clipboard - Format as BBCode”: {
“numbers”: false,
“multi_select”: true,
“filter”: “saturation(1.5)”
}
},[/pre]

Brightness:
[pre=#606060] // BBCODE menu items
“bbcode_panel”:
{
“To Clipboard - Format as BBCode”: {
“numbers”: false,
“multi_select”: true,
“filter”: “brightness(1.2)”
}
},[/pre]

colorize:
[pre=#2D2D2D] // BBCODE menu items
“bbcode_panel”:
{
“To Clipboard - Format as BBCode”: {
“numbers”: false,
“multi_select”: true,
“filter”: “colorize(0)”
}
},[/pre]

hue (shift):
[pre=#2D2D2D] // BBCODE menu items
“bbcode_panel”:
{
“To Clipboard - Format as BBCode”: {
“numbers”: false,
“multi_select”: true,
“filter”: “hue(60)”
}
},[/pre]

Chain some together:
[pre=#FFFFFF] // BBCODE menu items
“bbcode_panel”:
{
“To Clipboard - Format as BBCode”: {
“numbers”: false,
“multi_select”: true,
“filter”: “hue(60);saturation(1.5);brightness(.8);invert”
}
},[/pre]

0 Likes

#86

I think you just made Instagram for coders.

0 Likes

#87

[quote=“quodlibet”]
I think you just made Instagram for coders.[/quote]

instacode?

I know, I hate myself a little for it :smile:.

0 Likes

#88

1 out of 5 *s

I need blur and vignette to make my code look pretty!1!!1!11!!!

(Also, torn edges would be nice)

0 Likes

#89

[quote=“C0D312”]1 out of 5 *s

I need blur and vignette to make my code look pretty!1!!1!11!!!

(Also, torn edges would be nice)[/quote]

Yes, I think I heard that code runs better if it is prettier.

0 Likes

#90

@facelessuser: you are now inscribed in my signature. classic.

0 Likes

#91

That’s funny :smile:.

0 Likes

#92

So, ever since I added background colors to scopes, I have been struggling with the getting the CSS right to support code wrapped in tables (so I can copy and paste into Outlook emails; and other emails), inline spans (they don’t seem to expand to fill the table unless they are inline-block; inline-blocks fix the gap issues, but they don’t wrap well), annotation underlines ( underlining the annotations with dotted underlines started to break when I added background colors; some weird overlaps etc.).

So I fixed the above issues finally, but the gaps in background color can return if you are using certain fonts. I removed the workaround (which really only helped 70% of the time, but also caused me other headaches). I now recommend if you are using a theme that has background colors to just hard code the font-face in the settings file to something reliable like Courier or Courier New (this font doesn’t cause gaps in background colors. It is also much more likely to be on another users computer if you share the html output.). I also changed the underline method for annotations; it now just uses text-decoration: underline; much more reliable when working with the spans and background colors and trying to keep the dotted border from getting overlapped with the odd dynamics that are going on with the spans.

Also added better tooltips for annotations that follow the mouse. I am hoping this is the last update for a bit. I have been getting tired of tweaking all of this stuff.

Its funny, if I just gave up in trying to wrap this stuff in tables, and gave up on the pretty wrapping (wrapping after the gutter), I could solve almost all of these issues quite easily, but the feature I use the most in this is copying to emails, so I need the table wrapping in order to handle themes with non-white backgrounds. So that clears it up. Everything should be more reliable now, but if you get gaps in background colors when using font X, try hard coding the settings file to always use a font like Courier (or something else that is equally reliable for monospace fonts).

Version 0.5.7

  • Better tooltips for annotations (they now follow the mouse)
  • Remove workaround to fix gaps in background color (it is recommended to just use a reliable font like Courier)
  • Change method of underlining annotations to work in wrap mode and non-wrap mode and with background colors
  • Fix for CSS in annotation table not handling comment overflow
0 Likes

#93

Could you add an air conditioner?

0 Likes

#94

I will have to figure out how to make it work with the air purification system first :smile:.

In all seriousness, I do think I am done with features (and bloat).

If I have to be honest though, the only thing I use ExportHtml for is pasting code to emails. It is funny, because ExportHtml started as a way to print from a browser, but I never print code.

0 Likes

#95

Wish I could dig up some 10 second youtube of 2 junkies talking about getting off the gear :smile:

Sublime + Python == Crack :smile:

0 Likes

#96

[quote=“castles_made_of_sand”]
Sublime + Python == Crack :smile:[/quote]

It’s funny because it’s true :smile:. The kind of code I do to pay my bills is very different than this kind of stuff. Python is a very fun language to code in and I also like coding topics that are far away from what I actually do…mainly because they are so different. It can be very addictive.

0 Likes

#97

What sort of stuff you usually write for $ ?

0 Likes

#98

Embedded systems/firmware. I do C/C++/(stare at assembly when I am debugging). A lot of coding directly with the hardware; dealing with registers, keeping memory footprint low, etc.

I like what I do, but stuff like this is a nice break from all the complexity and low level coding.

0 Likes

#99

That shit be whack. My brain just doesn’t cope with C/C++

Waspect for those whose can :smile:

0 Likes

#100

int(*f(char c))(int, long); ?

or, to put it another way…

void *((*fnp[4])())();

0 Likes

#101

[quote=“agibsonsw”]int(*f(char c))(int, long); ?

or, to put it another way…

void *((*fnp[4])())();[/quote]

precisely

0 Likes

#102

[quote=“castles_made_of_sand”]

[quote=“agibsonsw”]int(*f(char c))(int, long); ?

or, to put it another way…

void *((*fnp[4])())();[/quote]

precisely[/quote]

You guys are ridiculous :smile:.

Once you can code in C, you can pretty much code in anything. As soon as you get used to managing your memory and cleaning up, other languages are much easier. The one exception is assembly; that is just painful to code in. I did a small project in straight assembly in college…it was not fun…interesting and a good exercise, but not fun. That is why Python can be so fun, you don’t have to worry about memory so much and types etc. and you can dynamically do stuff, where in C, things are much more rigid.

0 Likes

#103

I quite agree. I wish I had pursued C early on (and Turbo Assembler…). It’s challenging to revisit though, after all the hand-holding that other languages and IDEs offer.

0 Likes

#104

Once you can code in C, you can pretty much code in anything.

Learn C in 21 days (while mastering haskell and clojure as byproduct)

A brain once stretched or something eh?

I’ll try and learn C properly one day. One day…

0 Likes