Pascal Emmet

I'll try to publish some code I use in my program.
Alextp
Posts: 37
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp » 07 Jun 2019 11:07

Good. Just updated readme.md with more text and formatted.

Alextp
Posts: 37
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp » 10 Jun 2019 12:50

Can you add, please, some sort of profiles? See here at the end
http://www.uvviewsoft.com/synwrite/file ... oding.html

syntax html - default profile is 'html', user can choose any profile.
syntax xml/xsl/svg - default profile is 'xml', user can choose another.
css syntaxes - profiles not used.

User avatar
Rickard Johansson
Site Admin
Posts: 5867
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson » 10 Jun 2019 18:08

Well, maybe not profiles. I think options are better and gives users and developers using the TEmmet class much more alternatives.

Some options could be:

* Indent after child tag (default true)
* All tags on separate lines (default false)
* End empty elements with closed slash /> (default true)
* Wordwrap (default false)
* WordwrapAtColumn (default 80)

I suppose we could add other options like "output expanded code on a single line" etc. I'm not sure what that is used for though :?

Alextp
Posts: 37
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp » 10 Jun 2019 19:00

Options: no hurry.

Can I publish your Emmet doc as this short html file?
Downloads.zip
(5.5 KiB) Downloaded 75 times

User avatar
Rickard Johansson
Site Admin
Posts: 5867
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson » 10 Jun 2019 19:50

Can I publish your Emmet doc as this short html file?
Yes 8)

User avatar
Rickard Johansson
Site Admin
Posts: 5867
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson » 26 Jul 2019 13:44

Updated emmet.pas to version 1.09 and added some text to readme.md.

User avatar
Rickard Johansson
Site Admin
Posts: 5867
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson » 01 Aug 2019 09:28

Version 1.10 fixed a few issues.
* Removed "public" keyword from TExpandOptions.
* Fixed an issue in ExtractFilters().

Alextp
Posts: 37
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp » 04 Jan 2020 00:16

Code: Select all

CommentTags: Boolean;         // Comment important tags (containing class or id attributes).
I don't see where this opt is used.
Last edited by Alextp on 04 Jan 2020 00:26, edited 1 time in total.

Alextp
Posts: 37
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp » 04 Jan 2020 00:25

p{@lorem}
doesn't consider option WordWrap from Options param, I always get nonwrapped lorem text, and I pass WordWrapAt=60.
<p>Lorem Ipsum posse alienum eos harum nobis, eloquentiamintellegebat assentior euis nullam melius? Putantsigniferumque agam mnesarchum vocent choro suscipianturaliquando agam iisque. Graeco euismod alii te phaedrumalii graecis.</p>

Alextp
Posts: 37
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp » 04 Jan 2020 09:24

ProcessTagMultiplication loops forever for "p*100000", so add there
"if Application.Terminated then exit" in the loop.

User avatar
Rickard Johansson
Site Admin
Posts: 5867
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson » 05 Jan 2020 21:56

1. I've fixed the missing CommentTags option. The filter |c works though.
2. You need to set the wordwrap option as well.

E.g.
var
rOptions: TExpandOptions;

rOptions.Wordwrap := True;
rOptions.WordwrapAt := 60;
sExpanded := FEmmet.ExpandAbbreviation(sAbbr, sSyntax, sSelText, sSection, bMultiCursorTabs, rOptions);

3. I'll see what I can do about the loop issue.

Thanks Alexey!

User avatar
Rickard Johansson
Site Admin
Posts: 5867
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson » 05 Jan 2020 22:57

I've updated Emmet.pas to version 1.11.

Alextp
Posts: 37
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp » 06 Jan 2020 22:07

WordWrap=on and WrapAt=60 gives such result for p{@lorem}

Code: Select all

<p>Lorem Ipsum eruditi; Accumsan tristique scripserit
	sensibus. Potenti utamur? Iriure dicat kasd tollit
	omittantur adolescens ius consetetur platonem
	necessitatibu dico vix natoque? Voluptatum erant
	petentium constituam appetere justo sensibus sociosqu.</p>
so strange indents?? why? better make this:

Code: Select all

<p>
ddd ddd ddd
ddddd dddd ddd.
</p>

Alextp
Posts: 37
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp » 06 Jan 2020 22:35

Better name for IndentChilds -> IndentNestedTags.

User avatar
Rickard Johansson
Site Admin
Posts: 5867
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson » 07 Jan 2020 11:29

Released Emmet v1.12.

* Fixed a word wrap issue in Lorem generated text.

Better name for IndentChilds -> IndentNestedTags.
Probably true (IndentChildElements would be better as well), but i'm not fond of changing option names after it's been released.

Post Reply