Pascal Emmet

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

Re: Pascal Emmet

Post by Alextp »

Good. Just updated readme.md with more text and formatted.
Alextp
Posts: 69
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

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: 6575
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

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: 69
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

Options: no hurry.

Can I publish your Emmet doc as this short html file?
Downloads.zip
(5.5 KiB) Downloaded 672 times
User avatar
Rickard Johansson
Site Admin
Posts: 6575
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

Can I publish your Emmet doc as this short html file?
Yes 8)
User avatar
Rickard Johansson
Site Admin
Posts: 6575
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

Updated emmet.pas to version 1.09 and added some text to readme.md.
User avatar
Rickard Johansson
Site Admin
Posts: 6575
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

Version 1.10 fixed a few issues.
* Removed "public" keyword from TExpandOptions.
* Fixed an issue in ExtractFilters().
Alextp
Posts: 69
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

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: 69
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

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: 69
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

ProcessTagMultiplication loops forever for "p*100000", so add there
"if Application.Terminated then exit" in the loop.
User avatar
Rickard Johansson
Site Admin
Posts: 6575
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

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: 6575
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

I've updated Emmet.pas to version 1.11.
Alextp
Posts: 69
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

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: 69
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

Better name for IndentChilds -> IndentNestedTags.
User avatar
Rickard Johansson
Site Admin
Posts: 6575
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

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