-
Notifications
You must be signed in to change notification settings - Fork 0
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
Custom documentation pages #1
Comments
😍 That looks fantastic! I can’t wait to have a proper look at this! You’ve just made me realise that the site isn’t particularly clear on the licensing. Currently the site isn’t open sourced just because the code is quick and dirty, but that shouldn’t really stop me making it public, so I’ll take a look at that in a couple of days. The license in the footer of the site is intended to refer to the main Shortcuts JS project (which is GPL-v3), not the actual website. I’ll release the website under MIT as there’s no reason not to. If I do that, you shouldn’t need any special approval to modify it. What do you need from me for us to look at getting this onto shortcuts.fun? Happy holidays!🎄 |
Awesome 😀
Only your cleverness in web design, I loved how you arranged the site and I would like to get suggestions on the documentation too. I tried to follow your folder scheme, I suppose this shouldn't conflict with your current site (it's my first time with React and Webpack, so I may have done something wrong). I temporarily edited the
I'll clear some bits and I'll push this as soon as I can. Happy holidays! 🎄 EDIT: you can now serve the React site locally using
|
I did some tests in the last couple of hours. The React routing can work on the GitHub Pages repository site, but it requires modifications that won't let Users that would like to contribute to the documentation will only have to run |
@xAlien95 where did you find the action icons? |
@gcordalis, Crunch.app can extract compressed assets in the bundled .ipa. |
This is fantastic! Thanks! |
Just so you know @xAlien95, the repo for Shortcuts.fun is now public. |
I've just got the react app running locally @xAlien95 and it looks great! Very good job reproducing the look of Shortcuts.fun, I'm just sorry it wasn't open-sourced sooner for you to use instead! The design of the docs so far is really nice, so carry on with exactly what you're doing. I'll gladly take a look at how the data can be generated from the typedoc output if you'd like? |
Thank you!
@joshfarrant, I placed everything in I'll fork shortcuts-js-website and I'll work on that.
I went for a
Thank you, this way you can personally decide what to include and what to not include in the custom api documentation page. As a side note, are you okay with using React Router for the website? I don't know how you set up your site server-side and if you can apply url rewrites. |
I'm happy keeping everything within the The other thing I should note is that I'm using Netlify to build/host both the docs and the main website. You shouldn't need to make any special considerations for that, but I thought it might be useful for you to know. That also means that using React Router is fine too. I'd be happy to take a look at the |
I meant to mention this morning @xAlien95, I've got the Actions page pulling data from the Typedoc output too. It's not perfect, but the main structure is there. It has required a couple of changes to the action files though unfortunately, so it might be a bit of a manual process for us to switch it over. For example, the /** @module actions/actions/scripting/variables/addToVariable */
import Variable from '../interfaces/Variable';
import WFWorkflowAction from '../interfaces/WF/WFWorkflowAction';
/**
* Add to Variable Action. Appends this action's input to the specified variable, creating the variable if it does not exist.
*
* ```js
* // Append the input to the variable named 'My Var'
* addToVariable({
* variable: variable('My Var'),
* });
* ```
*/
const addToVariable = (
/** The variable to add to */
options: {
variable: Variable;
},
): WFWorkflowAction => {
const {
variable,
} = options;
return {
WFWorkflowActionIdentifier: 'is.workflow.actions.appendvariable',
WFWorkflowActionParameters: {
WFVariableName: variable.Value.VariableName,
},
};
};
export default addToVariable;
export const icon = 86; The changes are on the first and last lines (maybe we could write something to automate moving it over using your The structure may still change, but at the moment it's working quite well 🙂 |
@joshfarrant, your solution doesn't specify actual section/groups names. What about this? TypeDoc accepts custom (multiline) tags: import Variable from '../interfaces/Variable';
import WFWorkflowAction from '../interfaces/WF/WFWorkflowAction';
/**
* Appends this action's input to the specified variable, creating the variable if it does not exist.
*
* ```js
* // Append the input to the variable named 'My Var'
* addToVariable({
* variable: variable('My Var'),
* });
* ```
*
* @action Add to Variable
* @section Actions > Scripting > Variables
* @section Contents > Something >
*/
const addToVariable = (
/** The variable to add to */
options: {
variable: Variable;
},
): WFWorkflowAction => {
const {
variable,
} = options;
return {
WFWorkflowActionIdentifier: 'is.workflow.actions.appendvariable',
WFWorkflowActionParameters: {
WFVariableName: variable.Value.VariableName,
},
};
};
export default addToVariable; This produces the following output in the generated .json: "comment": {
"shortText": "Appends this action's input to the specified variable, creating the variable if it does not exist.",
"text": "```js\n// Append the input to the variable named 'My Var'\naddToVariable({\n variable: variable('My Var'),\n});\n```\n",
"tags": [
{
"tag": "action",
"text": "Add to Variable"
},
{
"tag": "section",
"text": "Actions > Scripting > Variables"
},
{
"tag": "section",
"text": "Contents > Something >\n"
}
]
}, This let us to add multiple locations for actions that have more (for example, "Markup" is both in "Documents > Editing > Markup" and "Photos & Video > Editing > Markup"). If you would move those |
Ah cool, hadn't realised it supported custom tags, I'll give that a go as I agree it's much nicer 👍 |
As for the icons, my real const sections = [
['Actions', [
['Scripting', [
[null, [
['Text', 'Comment'],
['Scripting', 'Show Result'],
]],
['Content', [
['Calculator', 'Count'],
['Scripting', 'Get Name'],
['Scripting', 'Get Type'],
['Scripting', 'Nothing'],
['Scripting', 'Set Name'],
['Graph', 'View Content Graph'],
]],
...
['Device', [
['Battery', 'Get Battery Level'],
['Network', 'Get Current IP Address'],
['Scripting', 'Get Device Details'],
['Wi-Fi', 'Get Network Details'],
['AirplaneMode', 'Set Airplane Mode'],
['Bluetooth', 'Set Bluetooth'],
['Brightness', 'Set Brightness'],
['CellularData', 'Set Cellular Data'],
['DoNotDisturb', 'Set Do Not Disturb'],
['Flashlight', 'Set Torch'],
['Battery', 'Set Low Power Mode'],
['Sound', 'Set Volume'],
['Wi-Fi', 'Set Wi-Fi'],
]],
... while the icons images are the following: If a user has to manually add an icon to a new action, it would be a lot simpler to write something like /* @icon Scripting with all the icon .pngs placed somewhere outside of the
I agree for having everything in the How the linter and the node modules would work then? I'll wait for your starting point and I'll use that as a base 🙂 EDIT: I updated this momentaneous fork with a little stupid addition: the calendar action icons is live and reflects the actual date as in the Shortcuts app. I'll remove that if you don't like it. 😄 |
@joshfarrant, I set up a new
If you prefer having multiple scripts like EDIT: I'm removing
Moreover, a |
@joshfarrant, I just updated the You can run the site with
I'm interested in your thoughts about this and if I can eventually continue on this line. EDIT: I started parsing action details. What details should be included in your opinion? |
@joshfarrant, in the last couple of days I focused on this bit.
I saw that shortcuts.fun has been built with React, so I started to learn it.
I've almost named all the icon glyphs (joshfarrant#45) (and I discovered two unpublished ones that works too, red icons are the ones currently without names, I'm at 86.7%):
I also worked on an "Actions" page, in which all the actions should be listed following the sections in the Shortcuts app (I also found some minor errors in joshfarrant#6):
Since your site is under the following license:
I need your approval to publish these documentation pages in this fork.
The text was updated successfully, but these errors were encountered: