Skip to content
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

Flems in docs (#2348) [skip ci] #2348

Merged
merged 24 commits into from
Oct 14, 2019
Merged

Conversation

porsager
Copy link
Contributor

Added flems instead of the current codepen samples.

Description

I've added a check for any code boxes which was generated from a ```js markdown tag, and then convert them to Flems live sandboxes. This should be great for keeping the markdown docs pretty, and the website even better.

Motivation and Context

Fixes #526

How Has This Been Tested?

Manually tested on macos & windows in IE11, edge, safari, chrome & firefox

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • [*] Documentation change

Checklist:

  • [*] My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • [*] I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated docs/change-log.md

@porsager
Copy link
Contributor Author

The latest version is available here http://porsager.com/mithril-docs so you don't have to build to check it out ;)

Copy link
Member

@dead-claudia dead-claudia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM mod a few nits

docs/layout.html Outdated Show resolved Hide resolved
docs/layout.html Outdated Show resolved Hide resolved
docs/layout.html Outdated Show resolved Hide resolved
docs/layout.html Outdated Show resolved Hide resolved
docs/layout.html Outdated Show resolved Hide resolved
@porsager
Copy link
Contributor Author

Awesome points Isiah! Thank you for going through it!

I also fixed this issue with the header in IE
screenshot 2018-12-27 at 22 44 23

@porsager
Copy link
Contributor Author

I'm also unsure about the direction of the rings next to the logo (it has a transform 180deg) compared to the favicons?

@dead-claudia
Copy link
Member

@porsager Found the line, and I'd say just kill the transform there.

@porsager
Copy link
Contributor Author

porsager commented Feb 19, 2019

Just realized I never pushed the commit I had made way back then :-( Oh well.. Hopefully we can get it going again now :) Sorry.

@porsager
Copy link
Contributor Author

@isiahmeadows is there anything more to add here?

@dead-claudia
Copy link
Member

dead-claudia commented May 24, 2019

Quick question: is http://porsager.com/mithril-docs/ up to date?

Edit: fixed typo

@dead-claudia
Copy link
Member

Sorry for the delay - been away from the computer for a while.

@porsager
Copy link
Contributor Author

I'm not sure it was up to date, but it is now ;)

Copy link
Member

@dead-claudia dead-claudia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last nit, and I'm good with it: could you remove all the "Live Example" headings and just leave their contents (i.e. the flems segments) as-is? It's pretty clear from context they're live examples.

@dead-claudia
Copy link
Member

dead-claudia commented May 24, 2019

Also, I thought I'd point out your embed is broken: the insertion point isn't showing on the first line. Not something to fix on our end Edit: in this PR, but it'd certainly make them look a bit more editable. 😉

# Conflicts:
#	README.md
#	mithril.js
#	mithril.min.js
@porsager
Copy link
Contributor Author

porsager commented Sep 2, 2019

This all appears to be good now. I've merged latest master, and there's a preview available here: http://porsager.com/mithril-docs/index.html

@dead-claudia
Copy link
Member

Quick question: is there an escape hatch in case it's like an incomplete snippet or something?

@dead-claudia
Copy link
Member

My approval here is tentative. There's a bit more I need to go over before I'm ready to merge this, but it's more about whether an escape hatch is necessary now or if one can be hacked in later.

@porsager
Copy link
Contributor Author

porsager commented Sep 4, 2019

sorry, I don't think I understand what you mean by escape hatch?

@dead-claudia
Copy link
Member

@porsager I mean being able to tell the init script to not wrap the script up in a Flems embed on load.

@porsager
Copy link
Contributor Author

porsager commented Sep 6, 2019

Hmm, so a quicker way than comment out the initialization part?

@dead-claudia
Copy link
Member

@porsager I mean on a per-block basis, like if a single block is this:

view: function(vnode) {
	// code...
}

In that case, it's entirely nonsensical to try to wrap that into Flems. But since ES doesn't offer a parser API and I'd rather avoid executing code blocks (they might be using third-party APIs) in general, an escape hatch would be nice.

@porsager
Copy link
Contributor Author

porsager commented Sep 6, 2019

Ah now I get what you mean.

Code blocks are only turned into Flemses if you use js as language designation. For a regular non flems code block just use javascript.

@dead-claudia
Copy link
Member

@porsager Oh okay. In that case, could you update the contributing document to note that about the documentation, so people know the semantic difference?

@porsager
Copy link
Contributor Author

porsager commented Oct 14, 2019

Ok.. done

Copy link
Member

@dead-claudia dead-claudia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@dead-claudia dead-claudia changed the title Flems in docs Flems in docs (#2348) [skip ci] Oct 14, 2019
@dead-claudia dead-claudia merged commit d257025 into MithrilJS:next Oct 14, 2019
@porsager
Copy link
Contributor Author

Yay! Nice @isiahmeadows .. Sorry my respond cycle on this has been so long! Glad to finally see it merged.

@dead-claudia
Copy link
Member

No problem. My response times have been going up lately myself. 😉

@panoply
Copy link

panoply commented Sep 18, 2021

Reviving this one cause flems is still not being leveraged in docs.

@JAForbes JAForbes mentioned this pull request Apr 28, 2022
StephanHoyer pushed a commit that referenced this pull request May 16, 2022
* Initial addition of flems - fixes #526

* Fix leftover ```js code blocks

* Add DOCTYPE

* Fix edge & IE11

* Don't show console

* Change orientation on mobile

* Use mithril@next for playground link

* Improve loading and structure

* Fix header alignment in IE

* Don't rotate logo

* Fix conflicts

* Allow `js` tags

* Fix code block query

* Fix Routing section and flems

* Fix firefox

* Improve flems styling

* Improve copy

* Fix data -> body in m.request sample

* Add flems in docs usage description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed/Declined
Development

Successfully merging this pull request may close these issues.

Embed Flems.io code samples in the docs
3 participants