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

docs: refresh web design, fix several html, css and content issues #2831

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
726d3bf
Bump minimatch from 3.0.4 to 3.1.2
dependabot[bot] Feb 7, 2023
a1159b7
Bump async from 2.6.3 to 2.6.4
dependabot[bot] Feb 7, 2023
88da9e5
hyperscript: handles shared empty attrs, fixes #2821
kfule Feb 15, 2023
ad9aa97
Fix typos in `stream()` docs (#2825)
mtsknn Mar 12, 2023
5afbb45
fix: several css issues
tbreuss May 1, 2023
4203b91
fix: bigger hamburger & increase z-index (because of flems)
tbreuss May 1, 2023
727265e
fix: wrong version link href when in an archive
tbreuss May 1, 2023
5592047
fix: menu tweaks, hide 4th level, and more
tbreuss May 1, 2023
fc3e35c
fix: wrong anchors
tbreuss May 1, 2023
e8a6437
fix: fixed broken anchors, removed newlines
tbreuss May 1, 2023
0cba815
fix: fixed wrong anchor
tbreuss May 1, 2023
c6767e9
fix: use same font for all pre tags
tbreuss May 1, 2023
8094c64
docs: fixed lint issues
tbreuss May 2, 2023
4ed2260
docs: fix weird looking <code> within <a> tags
tbreuss May 2, 2023
3efc490
docs: switch odd/even background, no bg for code within td
tbreuss May 2, 2023
3a1637c
docs: xpath solution for weird looking a>code tags
tbreuss May 2, 2023
3efff0f
docs: no left-padding for ordered lists
tbreuss May 2, 2023
239035b
docs: set ol/ul list indentation
tbreuss May 2, 2023
281ac42
docs: mouseover for code>a-tag
tbreuss May 2, 2023
9557f3c
docs: set font-size to 14px for code within td's
tbreuss May 2, 2023
a4062f3
docs: break lines for very long inline code examples
tbreuss May 3, 2023
8388e62
docs: remove broken jsonp link
tbreuss May 3, 2023
00d00d3
docs: reduce left and right padding for inlin code examples
tbreuss May 3, 2023
1e5abae
docs: break lines of very long inline codes in p-tags only
tbreuss May 3, 2023
1817e8b
docs: replace & with and
tbreuss May 3, 2023
d3618de
docs: fix not-obvious toc hack, add an introductory text
tbreuss May 3, 2023
d451e7f
docs: hide first ruler after h1 consequently
tbreuss May 3, 2023
5d5864b
docs: cleanup header hierarchy on certain pages
tbreuss May 6, 2023
ee9af07
docs: add a 404 page
tbreuss May 7, 2023
dbcb235
docs: filter rc-versions from version selector
tbreuss May 7, 2023
94b2275
docs: filter rc-versions from version selector (2nd try)
tbreuss May 7, 2023
a45b808
docs: remove mithril jobs, reorder social submenu
tbreuss May 7, 2023
a4fef21
docs: move pages to misc section
tbreuss May 7, 2023
37b66ff
docs: remove docs links from misc section
tbreuss May 7, 2023
a80d67a
docs: update footer text and linkit
tbreuss May 8, 2023
a9586e2
docs: fix toc order
tbreuss May 13, 2023
f83f203
docs: two column layout with 100% height and scrollbars and other cha…
tbreuss May 18, 2023
47e0274
docs: slightly lighter base font color
tbreuss May 19, 2023
fc05fbe
docs: add link to censor page
tbreuss May 19, 2023
99b2330
docs: slightly adjust colors for pre, code, flems, prism
tbreuss May 19, 2023
23e55bc
docs: memorize scroll position of sidebar across page loads
tbreuss May 19, 2023
59775e0
docs: bump prism.js up to version 1.29.0
tbreuss May 19, 2023
e5f24cb
docs: use sessionStorage instead of localStorage
tbreuss May 19, 2023
f315afa
docs: add copyright
tbreuss May 20, 2023
b784f18
docs: edit changelog
tbreuss May 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 404 Not Found

Oops, the page you requested cannot be found.

The URL may be misspelled or the page you're looking for is no longer available.

Go to the [home page](https://mithril.js.org).
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Official change log for Mithril.js

PSA: changes to [`mithril/stream`](stream.md) are now specified in this changelog. I've also moved the old stream changelog into this file [here](#mithril-stream-change-log).

- Updated web design, fixed most obvious UX, UI, and design flaws, fixed obviously incorrect content [@tbreuss](https://github.com/tbreuss)
- Added `m.Fragment = "["` for an easier time with JSX setups. ([#2744](https://github.com/MithrilJS/mithril.js/pull/2744) [@dead-claudia](https://github.com/dead-claudia))
- Reduced package download size substantially by removing the archive of previous releases' documentation. ([#2561](https://github.com/MithrilJS/mithril.js/pull/2561) [@cztomsik](https://github.com/cztomsik))
- Improved error messages in multiple places. ([#2536](https://github.com/MithrilJS/mithril.js/pull/2536) [@dead-claudia](https://github.com/dead-claudia))
Expand Down
12 changes: 6 additions & 6 deletions docs/code-of-conduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Code of Conduct Covenant for contributors to the Mithril.js project

# Contributor Covenant Code of Conduct

## Our Pledge
### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
Expand All @@ -13,7 +13,7 @@ size, disability, ethnicity, gender identity and expression, level of experience
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards
### Our Standards

Examples of behavior that contributes to creating a positive environment
include:
Expand All @@ -35,7 +35,7 @@ advances
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities
### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
Expand All @@ -47,7 +47,7 @@ that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope
### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
Expand All @@ -56,7 +56,7 @@ address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement
### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [[email protected]](mailto:[email protected]?subject=Mithril%20Code%20of%20Conduct). All
Expand All @@ -71,7 +71,7 @@ members of the project's leadership.

As a general policy, we generally do not disclose any particular action taken in accordance with this Code of Conduct beyond those who need to know.

## Attribution
### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [https://contributor-covenant.org/version/1/4][version]
Expand Down
70 changes: 23 additions & 47 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,34 @@ Contribution guide for Mithril.js
-->
# Contributing FAQs

Contribution guide for Mithril.js.

- [How do I go about contributing ideas or new features?](#how-do-i-go-about-contributing-ideas-or-new-features?)
- [How should I report bugs?](#how-should-i-report-bugs?)
- [How do I send a pull request?](#how-do-i-send-a-pull-request?)
- [I'm submitting a PR. How do I run tests?](#i'm-submitting-a-pr-how-do-i-run-tests?)
- [How do I build Mithril.js?](#how-do-i-build-mithril?)
- [How do I build Mithril.js?](#how-do-i-build-mithriljs?)
- [Is there a style guide?](#is-there-a-style-guide?)
- [How do I embed live previews in docs?](#how-do-I-embed-live-previews-in-docs?)
- [How do I embed live previews in docs?](#how-do-i-embed-live-previews-in-docs?)
- [Why do tests mock the browser APIs?](#why-do-tests-mock-the-browser-apis?)
- [Why does Mithril.js use its own testing framework and not Mocha/Jasmine/Tape?](#why-does-mithril-use-its-own-testing-framework-and-not-mochajasminetape?)
- [Why doesn't the Mithril.js codebase use ES6 via Babel or Bublé? Would a PR to upgrade be welcome?](#why-doesn't-the-mithril-codebase-use-es6-via-babel-or-bublé?-would-a-pr-to-upgrade-be-welcome?)
- [Why doesn't the Mithril.js codebase use trailing semi-colons? Would a PR to add them be welcome?](#why-doesn't-the-mithril-codebase-use-trailing-semi-colons?-would-a-pr-to-add-them-be-welcome?)
- [Why does the Mithril.js codebase use a mix of `instanceof` and `typeof` checks instead of `Object.prototype.toString.call`, `Array.isArray`, etc? Would a PR to refactor those checks be welcome?](#why-does-the-mithril-codebase-use-a-mix-of-instanceof-and-typeof-checks-instead-of-objectprototypetostringcall,-arrayisarray,-etc?-would-a-pr-to-refactor-those-checks-be-welcome?)
- [What should I know in advance when attempting a performance related contribution?](#What-should-I-know-in-advance-when-attempting-a-performance-related-contribution?)
- [Why does Mithril.js use its own testing framework and not Mocha/Jasmine/Tape?](#why-does-mithriljs-use-its-own-testing-framework-and-not-mochajasminetape?)
- [Why doesn't the Mithril.js codebase use ES6 via Babel or Bublé? Would a PR to upgrade be welcome?](#why-doesn't-the-mithriljs-codebase-use-es6-via-babel-or-bublé?-would-a-pr-to-upgrade-be-welcome?)
- [Why doesn't the Mithril.js codebase use trailing semi-colons? Would a PR to add them be welcome?](#why-doesn't-the-mithriljs-codebase-use-trailing-semi-colons?-would-a-pr-to-add-them-be-welcome?)
- [Why does the Mithril.js codebase use a mix of `instanceof` and `typeof` checks instead of `Object.prototype.toString.call`, `Array.isArray`, etc? Would a PR to refactor those checks be welcome?](#why-does-the-mithriljs-codebase-use-a-mix-of-instanceof-and-typeof-checks-instead-of-objectprototypetostringcall,-arrayisarray,-etc?-would-a-pr-to-refactor-those-checks-be-welcome?)
- [What should I know in advance when attempting a performance related contribution?](#what-should-i-know-in-advance-when-attempting-a-performance-related-contribution?)
- [Do you all accept donations?](#do-you-all-accept-donations?)

## How do I go about contributing ideas or new features?
### How do I go about contributing ideas or new features?

Create an [issue thread on GitHub](https://github.com/MithrilJS/mithril.js/issues/new) to suggest your idea so the community can discuss it.

If the consensus is that it's a good idea, the fastest way to get it into a release is to send a pull request. Without a PR, the time to implement the feature will depend on the bandwidth of the development team and its list of priorities.



## How should I report bugs?
### How should I report bugs?

Ideally, the best way to report bugs is to provide a small snippet of code where the issue can be reproduced (via jsfiddle, jsbin, a gist, etc). Even better would be to submit a pull request with a fix and tests. If you don't know how to test your fix, or lint or whatever, submit anyways, and we can help you.



## How do I send a pull request?
### How do I send a pull request?

To send a pull request:

Expand All @@ -45,80 +43,58 @@ To send a pull request:
- push your changes to your fork
- submit a pull request (go to the pull requests tab in GitHub, click the green button and select your feature branch)



## I'm submitting a PR. How do I run tests?
### I'm submitting a PR. How do I run tests?

After having run `npm install` (a one-time operation), run `npm run test` from the command line to run all tests.

While testing, you can modify a test to use `o.only(description, test)` instead of `o(description, test)` if you wish to run only a specific test to speed up your debugging experience. Don't forget to remove the `.only` after you're done!



## How do I build Mithril.js?
### How do I build Mithril.js?

If all you're trying to do is run examples in the codebase, you don't need to build Mithril.js, you can just open the various html files and things should just work.

To generate the bundled file for testing, run `npm run dev` from the command line. To generate the minified file, run `npm run build`.



## Is there a style guide?
### Is there a style guide?

Yes, there's an `eslint` configuration, but it's not strict about formatting at all. If your contribution passes `npm run lint`, it's good enough for a PR (and it can still be accepted even if it doesn't pass).

Spacing and formatting inconsistencies may be fixed after the fact, and we don't want that kind of stuff getting in the way of contributing.



## How do I embed live previews in docs?
### How do I embed live previews in docs?

Any code tag marked as `js` and not `javascript` will automatically be wrapped in a live Flems preview.



## Why do tests mock the browser APIs?
### Why do tests mock the browser APIs?

Most notoriously, because it's impossible to test the router and some side effects properly otherwise. Also, mocks allow the tests to run under Node.js without requiring heavy dependencies like PhantomJS/ChromeDriver/JSDOM.

Another important reason is that it allows us to document browser API quirks via code, through the tests for the mocks.



## Why does Mithril.js use its own testing framework and not Mocha/Jasmine/Tape?
### Why does Mithril.js use its own testing framework and not Mocha/Jasmine/Tape?

Mainly to avoid requiring dependencies. `ospec` is customized to provide only essential information for common testing workflows (namely, no spamming ok's on pass, and accurate noiseless errors on failure)



## Why doesn't the Mithril.js codebase use ES6 via Babel or Bublé? Would a PR to upgrade be welcome?
### Why doesn't the Mithril.js codebase use ES6 via Babel or Bublé? Would a PR to upgrade be welcome?

Being able to run Mithril.js' raw source code in all supported browsers is a requirement for all browser-related modules in this repo. In addition, transpiled code is generally much bulkier.



## Why doesn't the Mithril.js codebase use trailing semi-colons? Would a PR to add them be welcome?
### Why doesn't the Mithril.js codebase use trailing semi-colons? Would a PR to add them be welcome?

I don't use them. Adding them means the semi-colon usage in the codebase will eventually become inconsistent. Besides, [we aren't the only one who've decided to drop the semicolon](https://standardjs.com/#who-uses-javascript-standard-style). (We don't use Standard, though.)



## Why does the Mithril.js codebase use a mix of `instanceof` and `typeof` checks instead of `Object.prototype.toString.call`, `Array.isArray`, etc? Would a PR to refactor those checks be welcome?
### Why does the Mithril.js codebase use a mix of `instanceof` and `typeof` checks instead of `Object.prototype.toString.call`, `Array.isArray`, etc? Would a PR to refactor those checks be welcome?

Mithril.js avoids peeking at objects' [[class]] string for performance considerations. Many type checks are seemingly inconsistent, weird or convoluted because those specific constructs demonstrated the best performance profile in benchmarks compared to alternatives.

Type checks are generally already irreducible expressions and having micro-modules for type checking subroutines would add maintenance overhead.



## What should I know in advance when attempting a performance related contribution?
### What should I know in advance when attempting a performance related contribution?

You should be trying to reduce the number of DOM operations or reduce algorithmic complexity in a hot spot. Anything else is likely a waste of time. Specifically, micro-optimizations like caching array lengths, caching object property values and inlining functions won't have any positive impact in modern JavaScript engines.

Keep object properties consistent (i.e. ensure the data objects always have the same properties and that properties are always in the same order) to allow the engine to keep using JIT'ed structs instead of hashmaps. Always place null checks first in compound type checking expressions to allow the JavaScript engine to optimize to type-specific code paths. Prefer for loops over Array methods and try to pull conditionals out of loops if possible.



## Do you all accept donations?
### Do you all accept donations?

Yes, we do, over at [our OpenCollective page](https://opencollective.com/mithriljs). We don't actively seek donations, but they are very much appreciated and are used to support development and related expenses. Both one-time and recurring donations are accepted.
2 changes: 1 addition & 1 deletion docs/framework-comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Detailed comparison between Mithril.js and other popular frameworks
# Framework comparison

- [Why not X?](#why-not-insert-favorite-framework-here?)
- [Why use Mithril.js?](#why-use-mithril?)
- [Why use Mithril.js?](#why-use-mithriljs?)
- [React](#react)
- [Angular](#angular)
- [Vue](#vue)
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Instructions on how to install Mithril.js

# Installation

- [CDN and online playground](#cdn)
- [CDN and online playground](#cdn-and-online-playground)
- [npm](#npm)
- [Quick start with Webpack](#quick-start-with-webpack)

Expand Down
4 changes: 2 additions & 2 deletions docs/integrating-libs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ How you can integrate a third party library into a Mithril.js application, using

Integration with third party libraries or vanilla JavaScript code can be achieved via [lifecycle methods](lifecycle-methods.md).

## noUiSlider Example
### noUiSlider Example

```javascript
/** NoUiSlider wrapper component */
Expand Down Expand Up @@ -70,7 +70,7 @@ m.mount(document.body, Demo)

[Live Demo](https://flems.io/#0=N4IgZglgNgpgziAXAbVAOwIYFsZJAOgAsAXLKEAGhAGMB7NYmBvEAXwvW10QICsEqdBk2J4A9ACoJAAgBytAKoQAylAgATGACdpAdy0YADoe3S6WQ-RHSJYgDpowAVzTViEetNUbtACgCU0sAO0tIAbhg6cGqaWg4h0lowxE5aaEEJofTUSRiMiNLOru70vmFotJqBwemhdWJi0gCSaBDuGGoAXjDSAMxa6tKGkcQAntJqAEbShNowmXXRPjoAvNIVSt6x+DkweTBlFZr46rRYFBm1dYvEIwUADBQL1wZoAOYwBcBYEGgPF1gMAAPAoARnu91Yz2krH80KW21KAHInIZ1PskRcim4PGgyh0nPBqtDQuVKjB8HliFo4Ph6ABhQgYd4HCJQQlwZD3AC6cKu12kWHwSXUBl0AWhsIW7AW9CSWFoYU+hRcONKxP5oQa0npsGZqL6AyGI3GU2knnlio68Ji2hO8GptFGEv5Mv5YQgMF0BWxJTxGoFiWSqXSWF8SPUEDCSL51yhtXj8YckhkABEYArpEZDGYzpY0NZbA5fbjpOmFQFLqFYMRpHBCLRdFtTGswB04PNajXwgSemt7vFakkUmkq3UPV6faq-ZWaoHhyHBeHKcZMSSl0jDGvNQKw0jJk5iMR6NvA4G52fA2MTAV94fj2hT5eBdk1NQANZT4q42fry-1xtm1WaQAEIAKbW04h3S942fOo3Tg0JwKA6QAH5pDsEB0zgR1xiAzDpAKTD6VyRgvEgzC-2kWMz38J5oLrBsIOWaQADJWKXICLgvS8GSZFkvzVPEwgDRC2UJaQ1jCKjYLPWF6MvPctwucSYBo651JhBJE0HIUFRcYhfFOagnBwBh8EmSpRguctaD5NgOBATAcDwHY4AEGh6EYZgeDYbkqDUNB3wQFBOBcngKicCAEW0SgQFScgeBIYhDDgRAGhcQx3zeHYzjESLosggABUEACZ8FBfB7jESMcK0CAD0YfLaCimKtHwfg4uvbgQDgHIIEMUR2DCnqCratyPISvBktS9KxEy7LcqwZrWuKsqKqqmroupBrDxgFbCuWCautGEw8Bw0ZYAcka8B+YhCHq8gqCmpKj1mjK0CynLzDEO6HugEqNoANl+tp-qgDqPO687+sGvzWCAA)

## Bootstrap FullCalendar Example
### Bootstrap FullCalendar Example

```javascript
/** FullCalendar wrapper component */
Expand Down
2 changes: 1 addition & 1 deletion docs/jsx.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Explanation, examples, and build notes on how to use JSX in your Mithril.js-base

- [Description](#description)
- [Setup](#setup)
- [Production build](#production-build)
- [Using Babel with Webpack](#using-babel-with-webpack)
- [Production build](#production-build)
- [Differences with React](#differences-with-react)
- [JSX vs hyperscript](#jsx-vs-hyperscript)
- [Tips and Tricks](#tips-and-tricks)
Expand Down
4 changes: 2 additions & 2 deletions docs/keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Documentation on the special "key" attribute in Mithril.js, which tracks vnodes'

- [What are keys?](#what-are-keys?)
- [Key restrictions](#key-restrictions)
- [Linking model data in lists of views](#linking-model-data-to-views)
- [Linking model data in lists of views](#linking-model-data-in-lists-of-views)
- [Keeping collections of animated objects glitch-free](#keeping-collections-of-animated-objects-glitch-free)
- [Reinitializing views with single-child keyed fragments](#reinitializing-views-with-single-child-keyed-fragments)
- [Common gotchas](#common-gotchas)
Expand Down Expand Up @@ -438,7 +438,7 @@ users.map(function(user) {
})
```

The first binds the key to the `User` component, but the outer fragment created by `users.map(...)` is entirely unkeyed. Wrapping a keyed element this way doesn't work, and the result could be anything ranging from extra requests each time the list is changed to inner form inputs losing their state. The resulting behavior would similar to the [post list's broken example](#linking-model-data-to-views), but without the issue of state corruption.
The first binds the key to the `User` component, but the outer fragment created by `users.map(...)` is entirely unkeyed. Wrapping a keyed element this way doesn't work, and the result could be anything ranging from extra requests each time the list is changed to inner form inputs losing their state. The resulting behavior would similar to the [post list's broken example](#linking-model-data-in-lists-of-views), but without the issue of state corruption.

The second binds it to the `.wrapper` element, ensuring the outer fragment *is* keyed. This does what you likely wanted to do all along, and removing a user won't pose any issues with the state of other user instances.

Expand Down
Loading