ckeditor / ckeditor4-sdk

A set of software development tools for CKEditor 4 along with samples.
Other
18 stars 21 forks source link

Check if it's possible to port CKEditor SDK to Umberto #259

Open wwalc opened 6 years ago

wwalc commented 6 years ago

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.

msamsel commented 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:

  1. checkout in ckeditor-docs to sdk-port branch
  2. checkout umberto to sdk-port branch
  3. link umberto in ckeditor-docs
    • use npm link inside Umberto folder
    • use npm link umberto inside ckeditor-docs folder
  4. Update submodules in ckeditor-docs there appear ckeditor-presets dependency
  5. Use grunt docs or grunt docs-serve command to build docs with sdk samples

How samples are build:

  1. There is folder docs/sdk/examples which is used as samples source
  2. There is build ckeditor standard-all version from ckeditor-presets submodule
  3. Result is copied to docs/sdk/examples/vendors/ckeditor
  4. Folders docs/sdk/examples/vendors and docs/sdk/examples/assets are copied to output directory
  5. html files in docs/sdk/examples are processed
    • title is read and used as title of samples (it appears in navigation tree)
    • meta sdk-samples is used as names on "get samples source code" list
    • tag with class "sdk-contents" is used as sample content embed in umberto
    • tags with attribute "data-sample" are stored additionally and used during "get samples source code" building

Some more info:

screen shot 2018-07-16 at 11 55 19 screen shot 2018-07-16 at 11 55 35 screen shot 2018-07-16 at 11 55 48

mlewand commented 6 years ago

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:

Things to do from here:

All in all, that's a solid ground to refresh the SDK structure.

wwalc commented 6 years ago

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
wwalc commented 6 years ago
dkonopka commented 6 years ago

When I was trying to fix "Get Sample Code", I've found some wrong markup (content inside <h2>):

screen shot 2018-07-25 at 13 21 34
msamsel commented 6 years ago

"Tips" are lost, see https://sdk.ckeditor.com/samples/pastefromword.html

Those tips are clearly visible in my build version. screen shot 2018-07-26 at 16 04 48

dkonopka commented 6 years ago

☝️ @msamsel, I've fixed it here: https://github.com/cksource/umberto/commit/5bd39f132e7aed118e9ab111a24750d38be688a4.

msamsel commented 6 years ago

@AnnaTomanek, @wwalc, @mlewand what we want to do with navigation in SDK? How do you see it?

dkonopka commented 6 years ago

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):

Questions:

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)?

wwalc commented 6 years ago

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.

wwalc commented 6 years ago

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/.

msamsel commented 6 years ago

@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: screen shot 2018-08-02 at 12 02 50

wwalc commented 6 years ago

Bugs found so far:

wwalc commented 6 years ago
msamsel commented 6 years ago

Current status:

Other stuff should be solved in current sdk-port branches.

msamsel commented 6 years ago

@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

mlewand commented 6 years ago

I had a look at it, and good job so far, really like it.

Issues

Enhancements

All of the following points could be as well extracted into separate issues, that's totally fine.

dkonopka commented 6 years ago

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.

Proposal of accordion "Sample code"

screen shot 2018-08-21 at 14 47 20
wwalc commented 6 years ago

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.

msamsel commented 6 years ago

@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?

Umberto:

screen shot 2018-08-23 at 14 14 32

Old SDK:

screen shot 2018-08-23 at 14 14 42

dkonopka commented 6 years ago

@msamsel I've just fixed it, CSS Specificity for the main <h1> was too generic.

screen shot 2018-08-23 at 16 49 29
msamsel commented 6 years ago

@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.

AnnaTomanek commented 6 years ago

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: screen shot 2018-08-24 at 14 57 19

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": screen shot 2018-08-24 at 14 48 45

Can we have a different proposal for this, please?

wwalc commented 6 years ago

Blockers