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

Pad pane - HTML export of notepad. #225

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Pad pane - HTML export of notepad. #225

wants to merge 10 commits into from

Conversation

timbl
Copy link
Contributor

@timbl timbl commented Feb 17, 2020

Add the ability to make an HTML export of the notepad.

@michielbdejong
Copy link
Contributor

Great stuff! I'll review https://github.com/solid/solid-ui/pull/206 first and then this one.

package.json Outdated
@@ -89,7 +89,7 @@
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "npm test"
"pre-push-disabled": "npm test"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please exclude this change from your PR

@@ -53,7 +53,7 @@
"contacts-pane": "^2.0.0",
"folder-pane": "^2.0.1",
"issue-pane": "^2.0.0",
"meeting-pane": "^2.0.0",
"meeting-pane": "^2.0.7",
Copy link
Contributor

Choose a reason for hiding this comment

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

Please exclude this change from your PR

@@ -1539,9 +1539,9 @@
}
},
"@types/babel__core": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please exclude this change from your PR

import { PaneDefinition } from 'pane-registry'
const { IndexedFormula, NamedNode, literal } = $rdf
Copy link
Contributor

Choose a reason for hiding this comment

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

What is internalPane, how is it related to the pad pane, and why do you propose we add the $rdf global to this file, rather than referring to the individual imports like IndexedFormula, NamedNode, etc directly, like it was?

subject,
sym('http://www.w3.org/2007/ont/link#uri'),
store.sym('http://www.w3.org/2007/ont/link#uri'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Does store.sym do the same as $rdf.namedNode or is there a difference?

@@ -1,441 +0,0 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this code unused? If so, then yes please delete it! But we should make it a separate PR, since this is unrelated to the pad pane.

@@ -1,14 +1,13 @@
/* -*- coding: utf-8-dos -*-
Outline Mode Manager
*/
var panes = require('pane-registry')
const panes = require('pane-registry')
Copy link
Contributor

Choose a reason for hiding this comment

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

These changes seem unrelated as well?
We can do this kind of cleanup at the same time as moving this file to typescript, adding unit tests for it, fixing up its documentation, and adding examples for how to use the functions it exports.

@@ -1,8 +1,10 @@
import { authn, icons, ns, pad, widgets } from 'solid-ui'
import { authn, icons, ns, participation, pad, utils, widgets } from 'solid-ui'
Copy link
Contributor

Choose a reason for hiding this comment

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

These changes will not be necessary if we exclude the refactor work from https://github.com/solid/solid-ui/pull/206, like I did in https://github.com/solid/solid-ui/pull/211.

@@ -190,16 +192,38 @@ const paneDef: PaneDefinition = {
}
}

/** Button to Export the pad to HTML
*/
var exportHTMLButton = function (subject) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Great! I'll test this.

const copyIcon = icons.iconBase + 'noun_681601.svg'
return widgets.button(dom, copyIcon, 'Copy as HTML',
async function (_event) {
const htmlText = pad.notePadToHTML(subject, store)
Copy link
Contributor

Choose a reason for hiding this comment

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

Might need a lower-case p if we merge solid/solid-ui@a79b324

Copy link
Contributor

@michielbdejong michielbdejong left a comment

Choose a reason for hiding this comment

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

After we merge https://github.com/solid/solid-ui/pull/211 I'll create a new PR based on this one, that only contains the changes for adding the 'export to HTML' button, and then we can split the unrelated refactor work into more rigorous cleanup PRs.

@timbl
Copy link
Contributor Author

timbl commented Mar 26, 2020

Now should be just 1 file changed

$ git diff --name-status origin/master
M       src/pad/padPane.ts
$ 

@michielbdejong
Copy link
Contributor

Travis reports errors:
https://travis-ci.org/github/solid/solid-panes/jobs/667196157#L1546-L1556

ERROR in /home/travis/build/solid/solid-panes/src/pad/padPane.ts
ERROR in /home/travis/build/solid/solid-panes/src/pad/padPane.ts(207,21):
TS2339: Property 'webOperation' does not exist on type 'Fetcher'.
ERROR in /home/travis/build/solid/solid-panes/src/pad/padPane.ts
ERROR in /home/travis/build/solid/solid-panes/src/pad/padPane.ts(530,9):
TS2540: Cannot assign to 'style' because it is a read-only property.
ERROR in /home/travis/build/solid/solid-panes/src/pad/padPane.ts
ERROR in /home/travis/build/solid/solid-panes/src/pad/padPane.ts(556,16):
TS2540: Cannot assign to 'style' because it is a read-only property.

@michielbdejong
Copy link
Contributor

https://github.com/solid/solid-panes/pull/225/files still shows 4 files changed

Base automatically changed from master to main February 24, 2021 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants