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

RFC001 : Consider adding a function to export HTML documents and create a PSHTML object. #156

Closed
Stephanevg opened this issue Dec 17, 2018 · 4 comments
Labels
design discussion question Further information is requested RFC

Comments

@Stephanevg
Copy link
Owner

Stephanevg commented Dec 17, 2018

Currently each HTML document is exported via the following code on the user's side:

$PSHTMLContent > "Example6.html"

As this works fine, I would like to offer the ability to the end users to use a more 'standard' way of creating such a a document.

I would like to discuss the introduction of an export function, that would allow the following things:

  • Have a uniformly way to export HTML documents back to the parser (just returning the HTML content)
  • Save the HTML page to a specific location on disk

I would imagine something along these lines:

Out-PSHTMLDocument -Path [String/FileInfo] 

Options

Optionally, I would like to discuss the following:

  • Have an overall PSHTML Object that contains the HTML stucture tree
  • Have the classes, ID's and attributes

I would imagine a structure along these lines:

PSHTML.Document

Postion Type Id Class Attributes
[int] [String]Div,Body, etc.. [String]html id [String[]] html class [HashTable] Attributes

Perhaps also think of adding a content on the object, which would contain the content of each HTML tab part. It could potentially, also contain another PSHTML.Document, for nested elements.

Postion Type Id Class Attributes Content
[int] [String]Div,Body, etc.. [String]html id [String[]] html class [HashTable] Attributes [PSHTML.Document] or [String]

Some sources for inspiration for the exports:

@Stephanevg Stephanevg added help wanted Extra attention is needed question Further information is requested discussion design RFC and removed help wanted Extra attention is needed labels Dec 17, 2018
@Stephanevg
Copy link
Owner Author

As I will shortly introduce a depency on PowerShell 5 (Using classes), we have the possibility to use classes, and potentially implement design patterns.
For the PSHTML.Document we could perhaps use the composite pattern ? I think it will handle the problematic of the nested HTML elements pretty well, and we will be able to add functionality to every component centrally.

@Stephanevg
Copy link
Owner Author

@Stephanevg
Copy link
Owner Author

First version of Out-PSHTMLDocument has been added in this commit -> 0e4382c

@Stephanevg
Copy link
Owner Author

This was actually two points, exporting the HTML content via a cmdlet, and desining the PSHTML.Document object.

I consider the first point done in the commit above.
The second point will be tracked here --> #218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design discussion question Further information is requested RFC
Projects
None yet
Development

No branches or pull requests

1 participant