Author Topic: Code Display in Browser  (Read 5853 times)

0 Members and 1 Guest are viewing this topic.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2132
  • class keyThumper<T>:ILazy<T>
Code Display in Browser
« on: May 12, 2023, 08:38:44 PM »

I've been playing.

. . . with the idea of displaying c# code on a site.
Trying to leverage the bits I've learnt.


Is this too garish ??

Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Code Display in Browser
« Reply #1 on: May 12, 2023, 08:54:05 PM »
yikes .. there used to be a plugin for VS C# to HTML


kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2132
  • class keyThumper<T>:ILazy<T>
Re: Code Display in Browser
« Reply #2 on: May 12, 2023, 09:16:42 PM »
Yep !

One version gives me this.

Just need to ref some [additional]  font styles.
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2132
  • class keyThumper<T>:ILazy<T>
Re: Code Display in Browser
« Reply #3 on: May 12, 2023, 09:27:21 PM »
Output honours fonts in VS editor
I'll need to parse the file to change those , OR force the browser to download the fonts . . which is pretty economical

Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2132
  • class keyThumper<T>:ILazy<T>
Re: Code Display in Browser
« Reply #4 on: May 12, 2023, 09:36:33 PM »
This is my actual VS Editor
. .
The selected line is about 87 characters long
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Code Display in Browser
« Reply #5 on: May 13, 2023, 02:01:42 AM »
I've been using consolas. I wonder what GIThub uses for format code

pkohut

  • Bull Frog
  • Posts: 483
Re: Code Display in Browser
« Reply #6 on: May 13, 2023, 04:59:11 AM »
As someone with diminishing vision, I struggle with Windows font rendering and fight with it after every reinstall of 10/11.
For example I have 2 monitors of QHD which are 27 and 32 inch.  After much trial and error, a custom scaling of 127 is best for me for most windows applications and the desktop.  Having a stigmatism makes Dark themes a no go.  Some dark themes look great but cause headaches.

Out of the box, VS Code has fantastic font rendering all around, whereas VS absolutely sucks for me for side menus, dialog boxes, etc.,  editor looks OK.  A resent Google search of VS 2022 community fonts are blurry, brought me to a plugin of "Text Sharp".  After install, I'd say font are 80 percent in VSC.

One theme in VSC I think is fantastic is "Tomorrow Dark Blue", but it still causes headaches.  The theme I use for coding is "Blue (extra contrast)"

I am a less is more when it comes to themes and think the GitHub theme is a good balance.

BTW, the screenshot from D, look fuzzy, what programs are these from?

TIA
New tread (not retired) - public repo at https://github.com/pkohut

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Code Display in Browser
« Reply #7 on: May 13, 2023, 05:57:22 AM »
windows snip win+shift+s or something.

I noticed everything done in WPF, .net is blurry... but I'm old, so that could be it  :laugh:

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2132
  • class keyThumper<T>:ILazy<T>
Re: Code Display in Browser
« Reply #8 on: May 13, 2023, 06:00:17 AM »
Took me half hour to get rid of the inclined Text in the VS editor.
Visual Assist was the culprit.

Font is now Consolas again ( in place of Cascadia Mono ) . . . so no text style  downloads required for most people


Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

pkohut

  • Bull Frog
  • Posts: 483
Re: Code Display in Browser
« Reply #9 on: May 13, 2023, 01:02:13 PM »
windows snip win+shift+s or something.

I noticed everything done in WPF, .net is blurry... but I'm old, so that could be it  :laugh:

Sorry, meant what editor is the screen shot of? 
New tread (not retired) - public repo at https://github.com/pkohut

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Code Display in Browser
« Reply #10 on: May 13, 2023, 06:29:29 PM »
visual studio, my screen shot tool shrinks the image, why its blurry

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2132
  • class keyThumper<T>:ILazy<T>
Re: Code Display in Browser
« Reply #11 on: May 13, 2023, 11:41:11 PM »
Just need to add header and Line numbers.

Not quite as gaudy as the first couple.

Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Code Display in Browser
« Reply #12 on: May 14, 2023, 04:23:30 AM »
looks good!

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2132
  • class keyThumper<T>:ILazy<T>
Re: Code Display in Browser
« Reply #13 on: June 09, 2023, 09:08:06 PM »
Next Iteration :

The Code pane text is 20px.  Will probably revert to 16px  ( 1em or 12 pt )
The width suits about 82 characters. ( will have scroll bars when needed )

On a 'normal monitor' there will be enough room to have notes on the right section.

The side menu will eventually be a collapsable tree structure
I 'may' add tooltips to the menu options ( undecided )

Undecided about adding line numbers  :|

« Last Edit: June 09, 2023, 09:13:21 PM by kdub_nz »
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Code Display in Browser
« Reply #14 on: June 09, 2023, 09:47:04 PM »
looks great!

have you seen this? https://gist.github.com/