Open wwalc opened 6 years ago
@wwalc, @AnnaTomanek, @mlewand I've made proof of concept which ports entire SDK to ckeditor-docs. Below you can find few screenshots how it looks like. You can also build and test this version by yourself. To build locally docs with sdk examples follow those steps:
ckeditor-docs
to sdk-port
branchumberto
to sdk-port
branchnpm link
inside Umberto foldernpm link umberto
inside ckeditor-docs folderckeditor-docs
there appear ckeditor-presets
dependencygrunt docs
or grunt docs-serve
command to build docs with sdk samplesHow samples are build:
docs/sdk/examples
which is used as samples sourcedocs/sdk/examples/vendors/ckeditor
docs/sdk/examples/vendors
and docs/sdk/examples/assets
are copied to output directorydocs/sdk/examples
are processed
Some more info:
Get samples source code
require redesign, currently is just showed that is possible to be embed in document and might be easily modified
Just a note, if you want to avoid npm link
dance and have git
credentials configured correctly, just install given Umberto branch directly:
npm i git+ssh://git@github.com/cksource/umberto.git#sdk-port
Generates correctly, so that's cool to see!
Couple of things visible:
config.contentsCss
values were not retained, thus content of Accessibility Checker looks ugly.Things to do from here:
my-awesome-feature
I make a my-awesome-feature
branch in CKEditor dev repo that will be linked in sdk repo branch. That way we could build it in the same fashion as we build CKEditor previews.All in all, that's a solid ground to refresh the SDK structure.
Just a note that some warnings are shown when building docs:
Warning: Invalid links in ./ckeditor4/4.10.0/sdk/draganddrop.html:
'mailto:alice@example.com' - Alice
'mailto:h.finn@example.com' - Huckleberry Finn
'mailto:r.crusoe@example.com' - Robinson Crusoe
'mailto:lrrh@example.com' - Little Red Riding Hood
'mailto:' - ' + contact.name + '
Warning: Invalid links in ./ckeditor4/4.10.0/sdk/mentions.html:
'mailto:cflores@example.com' - @cflores
'mailto:' - @dwilliams
'mailto:mwilson@example.com' - @mwilson
'mailto:' - @mwilson
'mailto:{username}@example.com' - @{username}
Warning: Invalid links in ./ckeditor4/4.10.0/sdk/pastefromexcel.html:
'assets/pfw/CKEditor4.PFW.Balance.Sheet.xlsx' - sample Excel document
'assets/pfw/CKEditor4.PFW.Balance.Sheet.xlsx' - "Balance Sheet and Cash Flow" document
Warning: Invalid links in ./ckeditor4/4.10.0/sdk/pastefromword.html:
'assets/pfw/CKEditor4.PFW.Sample.Recognition_of_Achievement.docx' - sample Word document
'assets/pfw/CKEditor4.PFW.Sample.Mixed_styles.docx' - sample Word document with more complicated structure and styling
'assets/pfw/CKEditor4.PFW.Sample.Recognition_of_Achievement.docx' - "Recognition of Achievements" document
'assets/pfw/CKEditor4.PFW.Sample.Mixed_styles.docx' - A document with complex structure and formatting
<html><head>....</head><body>...
), make sure to not lose it. <pre>
) was lost in autogrow sample https://sdk.ckeditor.com/samples/autogrow.htmlWhen I was trying to fix "Get Sample Code", I've found some wrong markup (content inside <h2>
):
"Tips" are lost, see https://sdk.ckeditor.com/samples/pastefromword.html
Those tips are clearly visible in my build version.
☝️ @msamsel, I've fixed it here: https://github.com/cksource/umberto/commit/5bd39f132e7aed118e9ab111a24750d38be688a4.
@AnnaTomanek, @wwalc, @mlewand what we want to do with navigation in SDK? How do you see it?
We should keep navigation consistent with whole documentation design. It's obvious that navigation is missing categorized groups right now (like on current SDK e.g: Editor UI, Toolbar, Saving data):
1) Do we need filter search (PoC introduced here)? Current SDK has 59 subpages with samples, with introduced parent categories it will be very long list (~80 elements).
2) Do we need feature to fold/unfold tree in the navigation (ATM it's not used in the Guides)?
I think we will use just a few groups (folders) to group the most obvious examples like presets or end user features, without making so granular categories as before.
Ideally, just one category should be expanded at the beginning, while the other categories should be collapsed. But this is a feature which is even more important for https://docs.ckeditor.com/ckeditor4/latest/guide/index.html So for me, to not block the SDK migration, just assume that we'd have a few "folders" there (End-user Features, Integration features, Editor presets etc.).
Regarding questions:
1) For me the filter looks cool. But it must support searching in more than just a link title ("meta information) - I added my comment about it there.
2) Yes, but it should not be a blocker.
Even although we clear CDN cache on CloudFront whenever we deploy the new documentation, I've noticed that locally I still have to reload the page to see changes on docs.ckeditor.com.
So, ideally, if the documentation is requested form the /latest/ location, the linked library in examples should be loaded from folder such as /4.10.0/.
@wwalc, @AnnaTomanek, @mlewand
We can make another round of feedback.
There are sdk-port
branches in 3 repositories: ckeditor-docs
, umberto
, bigbang-docs
.
It's required to install dependencies in ckeditor-docs if you haven't done it earlier. It's also required to use git submodule update --init --recursive
inside ckeditor-docs to install presets dependancies properly.
Things to correct:
Sample picture:
Bugs found so far:
data-sample-short
attribute in "Get Sample Source Code". See https://github.com/ckeditor/ckeditor-sdk/blob/fe1ab83928d8fb62142616714254877e4f4bb8e2/samples/assets/simplesample.js#L469 and https://github.com/ckeditor/ckeditor-sdk/blob/fe1ab83928d8fb62142616714254877e4f4bb8e2/samples/assets/simplesample.js#L19 - because of that generated code samples contain unnecessary long content in textarea element.data-sample-preservewhitespace
sin't removed form the sample source code. Also if you look at the codesnippet example you will see that the white space is lost for legs: 4
Current status:
Other stuff should be solved in current sdk-port
branches.
@wwalc @AnnaTomanek I've add new link syntax inside documentation to link to SDK samples. And convert links to use it. Take a look if it's ok for you: https://github.com/ckeditor/ckeditor-docs/commit/671851ad1efe594745962e760c7c7bfb4e094833
I had a look at it, and good job so far, really like it.
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
reference twice.contentsCss: [CKEDITOR.basePath + 'contents.css', 'assets/accessibilitychecker/contents.css']
, should have spaces, and be split across lines for better readability.sdk/inline.html
) sdk sample:
<script type="template">
<script> // The inline editor should be enabled on an element with "contenteditable" attribute set to "true". // Otherwise CKEditor will start in read-only mode. var introduction = document.getElementById( 'introduction' ); introduction.setAttribute(
'contenteditable', true ); CKEDITOR.inline( 'introduction', { // Allow some non-standard markup that we used in the introduction. extraAllowedContent: 'a(documentation);abbr[title];code', removePlugins: 'stylescombo', extraPlugins: 'sourcedialog',
// Show toolbar on startup (optional). startupFocus: true } ); </script>
</script>
All of the following points could be as well extracted into separate issues, that's totally fine.
<code>
icon next to it.https://github.com/ckeditor/ckeditor-docs/issues/new?title=foo&body=bar
.Modal dialog should be gone, I believe showing code listing in dialog is an antipattern. Maybe it's better idea just to make these foldable.
Completely agree, but I would like to hear your opinion about Download
button. Do you really think it is neccessary? I can't find it in any docs, looks like Copy
is enough for the users.
Usually there's just "copy"option in other documentations because "partial" code snippets are listed there. Here you have the source code of a full file in each case, that's why "download" link makes sense.
@dkonopka I have one more trouble with proper styling inside inline editor. There are samples with this kind of editor like:
https://sdk.ckeditor.com/samples/savetextarea.html or https://sdk.ckeditor.com/samples/floatingui.html
Styles from Umberto leaks to inline editor (Editor takes styles from page). Generally there an issue with img
styles
Maybe you will have some idea how to improve it?
Fix those samples, or maybe provide some classes in Umberto to prevent such case? What do you think about it?
@msamsel I've just fixed it, CSS Specificity for the main <h1>
was too generic.
@wwalc current stage is that I think pretty much all bugs was fixed. remain things:
Docs should build from sdk-port
branches in ckeditor-docs, big-bang-docs and umberto.
I have some doubts about what happened with the documentation link in the samples.
It used to be really prominent, to make it clear that the samples are complemented with docs:
Now it landed as a small icon with no caption that I honestly totally ignored as "it's so small that it must be insignificant, there is this info or whatever else there, maybe it's the source or license or whatever else that I don't care about":
Can we have a different proposal for this, please?
grunt docs-serve
in ckeditor-docs
.ckeditor4/latest/examples/timestamp.html
not ckeditor4/latest/sdk/timestamp.html
).The autotag example is broken (last tutorial) in Chrome.
@wwalc, @AnnaTomanek it seem like this sample is not working in current SDK as well: https://sdk.ckeditor.com/samples/autotag.html
I see there was change in repository and now plugins are distributed differently. It will be required updated of files which was used to move SDK to Umberto
After consultation with @wwalc it seems to be issue somehow related to uBlock
plugin in Chrome.
@AnnaTomanek Because of GitHub icons location in the header, the only solution to improve discoverability of documentation link is simple: WDYT?
@dkonopka Visually looks 👍 for me. As for the link text it can be corrected at any moment when @AnnaTomanek is back.
It looks like the editor is not created correctly when building the documentation website. I had to check the examples by running grunt docs-serve in ckeditor-docs.
@wwalc I cannot reproduce it. It seems to work fine for me. I know that I correct script responsible for building to wait till the end. This should also fix mentioned situation. Maybe git made some tricks and doesn't refresh this script for you?
It looks like the editor is not created correctly when building the documentation website. I had to check the examples by running grunt docs-serve in ckeditor-docs.
@wwalc I cannot reproduce it. It seems to work fine for me. I know that I correct script responsible for building to wait till the end. This should also fix mentioned situation. Maybe git made some tricks and doesn't refresh this script for you?
It seems that editor was build completely asynchronously without waiting for rest of the process. That's why it worked after first fail. Right now it's working as it should.
So far I found just one blocker: ckeditor4/latest/examples/easyimage.html is broken, the same image is uploaded by EI and CKFinder. The sample should be adjusted somehow so that the configuration from common-examples-config.json did not interfere with this example. So, only Easy Image should effectively be enabled there.
I tried some quick hack in this sample with
<script>
CKEDITOR.on('instanceLoaded', function(evt) {
evt.editor.config.uploadUrl = false;
evt.editor.config.filebrowserBrowseUrl = false;
evt.editor.config.filebrowserImageBrowseUrl = false;
evt.editor.config.filebrowserUploadUrl = false;
evt.editor.config.filebrowserImageUploadUrl = false;
});
</script>
but were kinda unlucky. Note: I intentionally ommitted data-sample
attribute there.
@wwalc branch sdk-port is updated. There was required a little bit more tricky script ;)
<script>
CKEDITOR.once( 'instanceCreated', function( evt ) {
evt.editor.once( 'configLoaded', function( evt ) {
delete evt.editor.config.uploadUrl;
delete evt.editor.config.filebrowserBrowseUrl;
delete evt.editor.config.filebrowserImageBrowseUrl;
delete evt.editor.config.filebrowserUploadUrl;
delete evt.editor.config.filebrowserImageUploadUrl;
} );
} );
</script>
Try the cheapest possible option. Use the existing HTML code for source files instead of markdown. The "Get Sample Source Code" should work as before.