Skip to content

Readme edit#3

Open
ibnlanre wants to merge 2 commits intomahhov:masterfrom
ibnlanre:readme
Open

Readme edit#3
ibnlanre wants to merge 2 commits intomahhov:masterfrom
ibnlanre:readme

Conversation

@ibnlanre
Copy link
Copy Markdown

My first use on import following the instructions led to an error, and it took me a while to figure out. I later realised what I was doing wrong, and thought it would be to the advantage of others not to abandon this awesome module because of such errors. Apart from code edits, I made some aesthetic changes as well, while the others came out of good MD practices and prettier reformatting.

Copy link
Copy Markdown
Owner

@mahhov mahhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thansk for catching the typos and improving the styles.
I made some comments on certain styling changes that I don't think are ideal..

- `inline-environment-variables` replaces references to `process.env.<envVarName>` with their values in a JS file.

# Installation
---
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of manually styling md's and would rather the md renderer do it's thing. Not only because I trust the renderer more than myself to decide when to add lines for best readability, but also because manually doing this could lead to consistency issues.

```js
// src/main.js
console.log('Welcome');
console.log("Welcome");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't consistent with either the src nor js common style.

```

`$ inline-scripts src/index.html out/index.html`
`$ inline-script-tags src/index.html out/index.html`
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this!

<!-- out/index.html -->
<p>Welcome</p>
<script>console.log('Welcome');</script>
<script>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this is easier to read, it's actually inaccurate. The script doesn't generate the new lines and indentation.

<!-- src/index.html -->
<p>Welcome</p>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="style.css" />
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of unnecessary characters that don't improve readability.

<!-- out/index.html -->
<p>Welcome</p>
<img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==">
<img
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like above, the script doesn't line-wrap, and I think the output snippet should reflect the actual behavior.

add: (a, b) => a + b,
double: a => a * 2,
increment: a => a++,
square: (a) => a * a,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like above, not a fan of the unnecessary ()

All scripts usually take 2 parameters: the input and output files.

`$ inline-scripts src/index.html out/index.html .`
`$ inline-[script_type] src/index.html out/index.html`
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for consistency, let's prefer dash-case to underscore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants