-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
2.0.0 #708
base: master
Are you sure you want to change the base?
2.0.0 #708
Conversation
Remove UrlsLinked adjustment--we'll have a better way of doing that later
Remove tests that test old core and extension features Comment out test for no markup independent of safe mode
Issue on pre PHP 7 may be to do with method name and not call syntax as suspected
Interrupted implies previousEmptyLines > 0 in incoming Context
Normally this name might be too vague for an interface, but implementing this interface is a fairly special use case. We can expect dedicated types here (so method name unlikely to be an issue).
@BenjaminHoegh I've converted ParsedownExtra to be compatible with this branch over at erusev/parsedown-extra#172. Currently, the plan would be for "extensions" in the new world to implement the Using Parsedown with ParsedownExtra would look something like: $Parsedown = new Parsedown(new ParsedownExtra);
$actualMarkup = $Parsedown->toHtml($markdown); This would allow multiple extensions to be composed together, so that if there was another extension, say, E.g. $Parsedown = new Parsedown(ParsedownExtra::from(ParsedownMath::from(new State))); $Parsedown = new Parsedown(ParsedownMath::from(ParsedownExtra::from(new State))); Provided all extensions implement the A When writing the docs for new extensions to follow, I think it is a good idea to encourage extensions to document the state modifications they do so that a user can add these manually if they so wish. This, ultimately, will allow a user fairly granular control to try to make extensions interoperable (especially if extensions are large and contain quite a few behaviours). For instance, if a user only wanted the "abbreviations" feature from ParsedownExtra and nothing else, then they could manually construct: $State = new State;
$BlockTypes = $State->get(BlockTypes::class)
->addingMarkedLowPrecedence('*', [Abbreviation::class])
;
$RenderStack = $State->get(RenderStack::class)
->push(Abbreviations::expandAbbreviations())
;
$State = $State
->setting($BlockTypes)
->setting($RenderStack)
;
$Parsedown = new Parsedown($State);
$actualMarkup = $Parsedown->toHtml($markdown); In the case of ParsedownExtra though, I've made each feature its own use Erusev\ParsedownExtra\Features\Abbreviations;
$State = Abbreviations::from(new State);
$Parsedown = new Parsedown($State);
$actualMarkup = $Parsedown->toHtml($markdown); This IMO, would be the ideal pattern for extensions to use: which allows very simple granular composability by the user, allowing them to pick just one feature, or the entire package of features with the extension as they wish. |
This isn't yet complete, but is a decent start
Adds a small non-technical introduction to help with intuition, after the object appears for the first time.
Seems this is now the equivalent and sanctioned way to do this.
Documentation 2.0
@aidantwoods is there a way to manipulate with |
There isn't. This is to make sure that mutations are localised and don't end up being in places where they weren't intended. As a plus to this approach, this means that the This allows things like copying a |
Depending on what you're trying to do, could it be made easier if there was a constructor or more getters made available for |
Just trying to make tasks using the |
|
||
```php | ||
$BlockTypes = $State->get(BlockTypes::class) | ||
->addingMarkedLowPrecedence('*', [Abbreviation::class]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing information about the different ways to add such as addingMarketHighPrecedence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need some more information about adding new elements
Big PR to track everything for planned changes towards 2.0.0—please leave reviews here (preferably by adding a review to the relevant code site), or make PRs targeting the
2.0.x
branch if you'd like to help.I don't plan on making any more changes here directly, rather changes can be merged into this via separate dedicated PRs.