LayoutFarm / HtmlRenderer

C# HTML Layout and HTML Rendering Engine
http://layoutfarm.github.io/HtmlRenderer/
Other
187 stars 40 forks source link

Notes on my intentions #11

Closed prepare closed 6 years ago

prepare commented 6 years ago

Hello @bjorn-ali-goransson, and those who come from https://github.com/AngleSharp/AngleSharp.Css/issues/2

If your code meet these ...

  1. No copyleft code
  2. Support .Net framework >=2.0
  3. No Linq

It makes me easier to integrate your code back to my repo.


I also try to figure out How to support more that 1 Html-Css Dom/Parser frameworks.

eg.

  1. HtmlKit - that is used in this repo.
  2. Pasta - my unfinished port of Google's Gumbo.
  3. Radius - attempt the bring AngelSharp to the HtmlRenderer, not finish.

so lets create some abstraction.

Please don't throw other frameworks away :)


Feel free to create issues about the HtmlRenderer here.

bjorn-ali-goransson commented 6 years ago

Those constraints would be no problem, florian do you have such constraints?

Supporting several parser would definetely be possible, you just make an abstraction layer above it.

But why, since anglesharp is the best? :smile:

No seriously, why?

Den 6 feb 2018 02:16 skrev "win" notifications@github.com:

@bjorn-ali-goransson https://github.com/bjorn-ali-goransson

If your code meet these ...

  1. No copyleft code
  2. Support .Net framework >=2.0
  3. No Linq

It makes me easier to integrate your code back to my repo.

I also try to figure out How to support more that 1 Html-Css Dom/Parser frameworks.

eg.

  1. HtmlKit https://github.com/jstedfast/HtmlKit - that is used in this repo.
  2. Pasta https://github.com/prepare/Pasta - my unfinished port of Google's Gumbo.
  3. Radius https://github.com/prepare/Radius - attempt the bring AngelSharp to the HtmlRenderer, not finish.

Feel free to create issues about the HtmlRenderer here.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/LayoutFarm/HtmlRenderer/issues/11, or mute the thread https://github.com/notifications/unsubscribe-auth/AAoyADwyPrexNTvKlB5wzIJdOJvx9llnks5tR6gLgaJpZM4R6We6 .

prepare commented 6 years ago

Why support more than 1 ?

I want other C# developers who have their framework can use the HtmlRenderer too.

I don't want them to throw their work away.

eg.

HtmlKit code help this repo come true => I continue to support it.

or Pasta => I want to study the Google code too ;)

prepare commented 6 years ago

And that is another way to ensure that the code has low dependency on others

bjorn-ali-goransson commented 6 years ago

HtmlKit almost looks like a SAX parser. Is it anything like traversing the DOM?

prepare commented 6 years ago

You can simply access each node by traveling through their DOM.

but no sophisticated traversing code now.

bjorn-ali-goransson commented 6 years ago

It sounds like an abstraction on top of the parsers should be simple.

prepare commented 6 years ago

I bind my RenderTree with the HtmlKit here...

https://github.com/LayoutFarm/HtmlRenderer/blob/master/Source/LayoutFarm.HtmlComposer/1_Composers/1_Builder/WebDocumentParser.cs#L40

and

https://github.com/LayoutFarm/HtmlRenderer/blob/master/Source/LayoutFarm.WebDom/0_WebDom.Parser/HtmlParser.cs#L21

bjorn-ali-goransson commented 6 years ago

I find the solution to be a bit strangely organized (if not unorganized 😅)

How does one get Deps ? Why not use NuGet?....

bjorn-ali-goransson commented 6 years ago

For example, I now have an empty HtmlRenderer\Source\Deps\BurningMineCurve\CurveUtils, dunno how it got created.

And it gives hundreds of errors when opening the solution (of course since Deps only contains empty dirs)

[Failure] Could not find file '... HtmlRenderer\Source\Deps\BurningMineCurve\CurveUtils\VectorHelper.cs'.

prepare commented 6 years ago

please see this https://github.com/LayoutFarm/HtmlRenderer/blob/master/Source/Deps/README.md

prepare commented 6 years ago

The Rendering Part ((https://github.com/PaintLab/PixelFarm) is a huge part, quite complex and yes not well-organized :'(

since It is planned to support real-time HtmlRendering. (esp. UI application / software/hardware rendering).

but once you get the PixelFarm code => all the code are there.

prepare commented 6 years ago

At this development stage, you may need to see all the PixelFarm code (helping organize them too is welcome).


I cheer you, Don't give up with that complex part!

prepare commented 6 years ago

I am investigating / developing more on Radius (https://github.com/prepare/Radius)

:)