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

Add posibility to write asset as content #307

Open
Stephanevg opened this issue Jul 6, 2024 · 1 comment · May be fixed by #308
Open

Add posibility to write asset as content #307

Stephanevg opened this issue Jul 6, 2024 · 1 comment · May be fixed by #308
Assignees
Labels
enhancement New feature or request

Comments

@Stephanevg
Copy link
Owner

Stephanevg commented Jul 6, 2024

Write-PshtmlAsset will write the asset as file. Add parameter -AsContent to write the contents of the asset directly in the html document instead of the link element.

Details

Assets/JessAssets/JessCssfile.css contents:

table.paleBlueRows {
  font-family: "Times New Roman", Times, serif;
  border: 1px solid #FFFFFF;
  width: 350px;
  height: 200px;
  text-align: center;
  border-collapse: collapse;
}

Example:

Write-PSHTMLAsset -Name "JessAssets"

will add the following in the html document:

<Link rel='stylesheet' type=text/css href='C:/PathToScriptFolder/Assets/JessAssets/JessCssFile.css' >

This works well for cases where these files are available (for webpages or static pages where the folder structure is presenent and accesible).
But for cases where the html page should be sent per email for example, or when the files are not accessible anymore, it would be interessting to have the possibility to write the full content directly into the html document.

cases

.css files

.css files should be outputed into a styles element. like this

<style>
  table.paleBlueRows {
    font-family: "Times New Roman", Times, serif;
    border: 1px solid #FFFFFF;
    width: 350px;
    height: 200px;
    text-align: center;
    border-collapse: collapse;
  }
</style>

.js

.js files (Asset of type script) shall be exported in a script element as followed

<script>
 //Scriptfile content here
</script
@Stephanevg Stephanevg added the enhancement New feature or request label Jul 6, 2024
@jpomfret
Copy link
Contributor

jpomfret commented Jul 9, 2024

Oh neat - this would be awesome!

@Stephanevg Stephanevg linked a pull request Nov 13, 2024 that will close this issue
3 tasks
@Stephanevg Stephanevg self-assigned this Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants