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

BrowseDoc: Support .browse files #92

Open
wants to merge 18 commits into
base: pre
Choose a base branch
from
Open

BrowseDoc: Support .browse files #92

wants to merge 18 commits into from

Conversation

atfaust2
Copy link
Contributor

@atfaust2 atfaust2 commented Sep 9, 2020

No description provided.

@atfaust2 atfaust2 changed the title Autodoc for browse [WIP] Autodoc for browse Sep 9, 2020
@@ -23,6 +23,7 @@ rule toPrecision {

# Math.* fns
rule abs { bind x; return (native:fn abs $x) }
#* @help { The arc-cos of a number }
Copy link
Member

Choose a reason for hiding this comment

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

should we use ## instead of #*?

Copy link
Member

Choose a reason for hiding this comment

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

I have no strong preference either way

Copy link
Contributor Author

@atfaust2 atfaust2 Sep 10, 2020

Choose a reason for hiding this comment

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

That definitely looks better but I chose this because I was thinking of how people like to do

###################
#  Section title  #
###################

Which would trigger the ## check

Copy link
Member

Choose a reason for hiding this comment

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

While that's true, it's fine because we have a second layer of @help... (i.e. they need to use @ for a tag)

Even in JS, people do this all the time:

/*********************\
 *** Section Title ***
\*********************/

@pranaygp pranaygp changed the base branch from master to pre September 14, 2020 22:54
@pranaygp pranaygp changed the title [WIP] Autodoc for browse Autodoc for browse Sep 14, 2020
@pranaygp pranaygp changed the title Autodoc for browse BrowseDoc: Support .browse files Sep 14, 2020
set HOUR $MINUTE * 60
set DAY $HOUR * 24
set WEEK $DAY * 7
#*Number of seconds in a minute
Copy link
Member

@pranaygp pranaygp Sep 15, 2020

Choose a reason for hiding this comment

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

Space after #* please 🙏

Also, I'd love it if you (in a new PR) can add this to the @browselang/format package so we can start formatting BrowseDoc :)

Copy link
Member

Choose a reason for hiding this comment

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

Create an issue and self-assign if you're doing something else and don't want to do this right now. The formatter is fun to work with though :)

@@ -65,7 +66,9 @@ const main = async () => {

const outputs = await Promise.all(
pages.map(([stem, doc]) =>
markdownPlugin(doc, path.join(outPath, stem + ".md"))
Object.keys(doc).map((scope) =>
Copy link
Member

@pranaygp pranaygp Sep 15, 2020

Choose a reason for hiding this comment

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

I did this earlier so the output can include docs for multiple scopes into a single file.

This is important sometimes. For example:

  • the rule scope (which has bind and return doesn't need it's own unique doc page, but lives inside the std doc): https://github.com/windsorio/browse/wiki/API-Reference. The docs there even use @link between the scopes since they are tightly coupled, so it's imperative that they are in the same file

  • the page and browser scopes should be in a single file, maybe called web since they are coupled. Or, they could be in their own files, but should probably atleast be in their own folder since they are tightly coupled

I think what I did was "better" - it's still opinionated since we assume files are the final output, but really we're copy-pasting things to github wiki, and ideally we can abstract this out like JSDoc/JavaDocs etc. does so it simply spits out an IR, and then there's a different plugin that produces HTML/Markdown/.txt files etc.

I think you're going a step back from that by limiting things to one scope per file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIRC I did this because I wanted the default behavior to be that the filename was the scope name in the case that the user doesn't provide an @name argument. Using this method the default name for Math was 'main' because it's in the main file. I'll fix it so that both functionalities stay intact.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense

pranaygp and others added 5 commits September 14, 2020 17:54
* origin/pre:
  format everything
  gitignore out in docs
  update publishing script and publish new stable version
  Bugs:  `match` scoping, `page` parsing  and optional (?) rule formatting (#95)
  Update thegazette.browse example to use pageConfig
  Undo headless change in twitch.browse example
  Add support for browserConfig and update examples
  prerelease version
  update snytax highlighter
  add example
  add throw and match rules
  remove ? web scraping functions
  add ? syntax for optional error handling for rules
  Format code with prettier (#91)
  Add .deepsource.toml
@vercel
Copy link

vercel bot commented Sep 28, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/windsor/browse/ibd7fbqiu
✅ Preview: https://browse-git-docs.windsor.vercel.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants