profile
viewpoint
Luca Casonato lucacasonato @antipycorp Netherlands https://lcas.dev I work at @antipycorp, and go to school. I use Linux on my PC. I love rockets and space.

lucacasonato/floatplaneapi 7

An unofficial API to interface with floatplane.com from own systems. This is not in any way affiliated with floatplane.com.

lucacasonato/date_extensions 1

Extensions to the default dart DateTime class

lucacasonato/frontmatter 1

handle frontmatter in files

lucacasonato/gowd-styling 1

Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)

codelympicsdev/api 0

API for codelympics.dev

codelympicsdev/auth 0

Auth screen for codelympics.dev

codelympicsdev/cli 0

Handle collecting challenge responses for codelympics.dev

codelympicsdev/web 0

Frontend for codelympics.dev

delete branch luca-rand/deno_doc

delete branch : nextjs

delete time in 17 hours

push eventbartlomieju/deno_doc

Luca Casonato

commit sha c4fd3814c2887e2fe5474a96e67c61d746fef77c

Moved to NextJS

view details

Luca Casonato

commit sha 1dfe95c340bf45f23783fc29ffc6fec15f30d977

Made home page work

view details

Luca Casonato

commit sha 46a2075cceda862c5713d49157cedd4d071cf76b

Cleaned up

view details

Luca Casonato

commit sha 19580b4e78cfc0b3e5a3ced7ee5e409ec11f982b

Fixed now deploy

view details

Bartek Iwańczuk

commit sha fe3ff2fd03f0147489ae6934f005b93d2b7fa56b

reset CI

view details

Luca Casonato

commit sha caac07e1d215377d3f577978ede4e65edc513803

Cleaned up links

view details

Bartek Iwańczuk

commit sha 08fffef8d2ae7fe4117c3dd9b70c73bf65ba2a25

reset CI

view details

Luca Casonato

commit sha c00c268dd9beb39c4156dcc01c39bf0d156316a2

Merge branch 'nextjs' of github.com:luca-rand/deno_doc into nextjs

view details

Luca Casonato

commit sha 378fe7ae63795bf8fdac95359dcff25c51aec165

Merge pull request #32 from luca-rand/nextjs NextJS + design changes

view details

push time in 17 hours

PR merged bartlomieju/deno_doc

NextJS + design changes

Moved to NextJS for hybrid side rendering + updated design + added index page.

+7144 -12106

8 comments

50 changed files

lucacasonato

pr closed time in 17 hours

push eventluca-rand/deno_doc

Luca Casonato

commit sha caac07e1d215377d3f577978ede4e65edc513803

Cleaned up links

view details

Luca Casonato

commit sha c00c268dd9beb39c4156dcc01c39bf0d156316a2

Merge branch 'nextjs' of github.com:luca-rand/deno_doc into nextjs

view details

push time in 17 hours

pull request commentbartlomieju/deno_doc

NextJS + design changes

Cool, deployed, but I get this: Screenshot 2020-03-31 at 10 49 31

Anyway, looks great, land when you think it's ready

Yup - deno doc does not support re exports yet, so two of the example links are just empty... I'll see if I manage to add re-exports to deno today. You can see some content with this link: https://deno-doc-git-fork-luca-rand-nextjs.bartlomieju.now.sh/deno.land/std/fs/copy.ts

lucacasonato

comment created time in 17 hours

pull request commentbartlomieju/deno_doc

NextJS + design changes

Correct. Could you change the settings on now to have the root path field be empty and change the template from 'Create React App' to 'Next JS'. Then it should work again.

lucacasonato

comment created time in 17 hours

push eventluca-rand/deno_doc

Luca Casonato

commit sha 19580b4e78cfc0b3e5a3ced7ee5e409ec11f982b

Fixed now deploy

view details

push time in a day

PR opened bartlomieju/deno_doc

Reviewers
NextJS + design changes

Moved to NextJS for hybrid side rendering + updated design + added index page.

+7144 -12085

0 comment

52 changed files

pr created time in a day

push eventluca-rand/deno_doc

Luca Casonato

commit sha 46a2075cceda862c5713d49157cedd4d071cf76b

Cleaned up

view details

push time in a day

push eventluca-rand/deno_doc

Luca Casonato

commit sha 1dfe95c340bf45f23783fc29ffc6fec15f30d977

Made home page work

view details

push time in a day

create barnchluca-rand/deno_doc

branch : nextjs

created branch time in a day

push eventbartlomieju/deno_doc

Luca Casonato

commit sha 287712d20f1d2fd772d90e888690230e8d132779

Hosted version using now-deno

view details

Luca Casonato

commit sha 6821260890b235c30fd2347d87ee089ccc2c764d

Changed to LinuxSignal

view details

Luca Casonato

commit sha c79483e3cb3b9c94d94ea5cfcebf122150c37d85

Fixed display

view details

Luca Casonato

commit sha 4dc5b3c35dec86b00fa4fb78ab9d56cebdc5c14d

Removed not required files

view details

Luca Casonato

commit sha 7569ba1364f586fabe299b165eb40543e62d7dd8

Merge pull request #31 from luca-rand/hosted2 First iteration of hosted

view details

push time in a day

delete branch luca-rand/deno_doc

delete branch : hosted2

delete time in a day

PR merged bartlomieju/deno_doc

First iteration of hosted
+187 -7119

1 comment

21 changed files

lucacasonato

pr closed time in a day

push eventluca-rand/deno_doc

Luca Casonato

commit sha 4dc5b3c35dec86b00fa4fb78ab9d56cebdc5c14d

Removed not required files

view details

push time in a day

push eventluca-rand/deno_doc

Luca Casonato

commit sha c79483e3cb3b9c94d94ea5cfcebf122150c37d85

Fixed display

view details

push time in a day

PR opened bartlomieju/deno_doc

Reviewers
First iteration of hosted
+155 -53

0 comment

10 changed files

pr created time in a day

issue commentbartlomieju/deno_doc

Hosted version of deno_doc (docs.deno.land)

It's meant to work but there are still some bugs in the parser I think. Also this uses deno 'stable' so things that are fixed on master don't work yet. I'll look into that specific case.

About the caching: We can set up the ZEIT CDN to cache for eg. one day and then have a way to force reload by using a query parameter. We could then show a 'Refresh now' link in the top left under or next to the 'Generated on' text. This should be relatively easy to implement. If we want to go for something else, we can probably use Cloudflare Workers (and Cloudflare Workers KV) to handle caching.

On a somewhat related note: If this is deployed as a standalone application to a seperate domain like https://docs.deno.land, I can also set up server side rendering for the React application, which would make initial load times a lot faster.

Do we want to use Now? It is really easy to use and pretty customizable as it is built on AWS Lambda (so we can do advanced things if required). It also does deploy previews and such like Netlify.

lucacasonato

comment created time in a day

PR opened denoland/deno_lint

Added useIsNaN lint
+92 -1

0 comment

6 changed files

pr created time in a day

PR opened denoland/deno_lint

Do deeper traversal

Fixes #5

There are some annoyances with how Rust's default trait method inheritance works. Implementing the one of AstTraverser methods in the rule will override the default trait method, and thus stop walking. Because Rust has no way to call the default trait method from an implementor (https://www.reddit.com/r/rust/comments/3uvfgx/how_to_call_default_trait_method/), the implementor will have to copy and paste the default trait code into their method (or we change the structure of AstTraverser to have a walk_* and super_walk_* method, where the default of walk_* is to call super_walk_*), to not stop the traversal. This is especially annoying for expressions, because they can be deeply nested in each other.

Dupe of #7

+493 -59

0 comment

1 changed file

pr created time in a day

issue openedbartlomieju/deno_doc

Hosted version of deno_doc (docs.deno.land)

It would be great to have a hosted version of deno_doc that you give a URL and it fetches that module, analyzes it, and displays it.

There are two reasonable approaches here:

  • have a serverless function or server that executes deno doc and responds to the client with the json output
  • wasmify the deno doc section of deno and use client side fetch() to fetch code and analyze it with the wasm

The first one is definitely easier, but requires a little bit more maintenance as it needs to be deployed, while the second one will be a lot harder to build, but requires nearly no effort on the deployment side.

I built a demo for the first approach that uses Zeit Now: a combination of static hosting, serverless function hosting and a CDN - https://deno-doc.lucacasonato.now.sh/deno.land/std/http/server.ts. It uses my project now-deno that you can use to deploy serverless Deno functions to Now. I made use of this for the actual backend parser, and just use a slightly adjusted version of the frontend in this repo for the display. The code can be found in this branch: https://github.com/luca-rand/deno_doc/tree/hosted2 (diff). This is still rudimentary, but it works really well.

Is this something that we want? Are there other approaches that might work better?

/cc @ry @bartlomieju

created time in a day

issue openeddenoland/deno

Programmatic access to `deno doc --json`

Something like this would be nice:

const documentationNodes = Deno.doc("https://deno.land/std/http/server.ts");

It should probably have the same permission model as the compiler API.

created time in a day

create barnchluca-rand/deno_doc

branch : hosted2

created branch time in a day

PR opened denoland/deno_lint

Do deeper traversal

Fixes #5

There are some annoyances with how Rust's default trait method inheritance works. Implementing the one of AstTraverser methods in the rule will override the default trait method, and thus stop walking. Because Rust has no way to call the default trait method from an implementor (https://www.reddit.com/r/rust/comments/3uvfgx/how_to_call_default_trait_method/), the implementor will have to copy and paste the default trait code into their method (or we change the structure of AstTraverser to have a walk_* and super_walk_* method, where the default of walk_* is to call super_walk_*), to not stop the traversal. This is especially annoying for expressions, because they can be deeply nested in each other.

+493 -59

0 comment

1 changed file

pr created time in a day

create barnchluca-rand/deno_lint

branch : deep-walking

created branch time in a day

push eventluca-rand/deno_doc

Luca Casonato

commit sha 67257f3d5ee851b151dc1420f3c33be7b0018a0b

Changed to LinuxSignal

view details

push time in 2 days

create barnchluca-rand/deno_doc

branch : hosted

created branch time in 2 days

push eventlucacasonato/now-deno

Luca Casonato

commit sha 134092b253d822bdf0d8f94be671fcc9535eccc1

close proc

view details

push time in 2 days

PR opened denoland/deno

fix(doc): Safely deal with optional ts_type

Deal with the optionality of types in deno doc.

Fixes #4523

+94 -30

0 comment

2 changed files

pr created time in 2 days

create barnchluca-rand/deno

branch : fix-4523

created branch time in 2 days

push eventlucacasonato/now-deno

Luca Casonato

commit sha 2bd78fb77b32f368b9956123b636206fe4f19aaf

Fixed import versions

view details

push time in 2 days

push eventlucacasonato/now-deno

Luca Casonato

commit sha 323b243eae04f590577d0d69cf154160c04ddb2a

Fixed testing import

view details

push time in 2 days

push eventlucacasonato/now-deno

Luca Casonato

commit sha 6f3e9abe51d2465c7de8054218f850fff379d20c

Updated deno version

view details

push time in 2 days

push eventlucacasonato/now-deno

Luca Casonato

commit sha c4eae74b271f8211c4f8a1fc5c5486e77e3463b0

Update deno

view details

push time in 2 days

PR opened lucacasonato/now-deno

New testing ci
+4 -5

0 comment

1 changed file

pr created time in 2 days

create barnchlucacasonato/now-deno

branch : new-testing

created branch time in 2 days

issue openeddenoland/deno_lint

[bug] walk_expression is only called for top level expressions.

It is not being called for function arguments, if statement tests, variable assignments, switch cases and all other non top level expressions.

The same is true for many other properties.

created time in 2 days

PR opened denoland/deno_lint

Added useIsNaN lint
+92 -1

0 comment

6 changed files

pr created time in 2 days

create barnchluca-rand/deno_lint

branch : use-isnan

created branch time in 2 days

issue commentdenoland/deno_lint

MVP lint rules

I think we should start with all of the recommended rules in the possible errors section of eslint. These are lints that prevent runtime errors, so they are most useful. Those would be:

  • [ ] for-direction
  • [ ] getter-return
  • [ ] no-async-promise-executor
  • [ ] no-compare-neg-zero
  • [ ] no-cond-assign
  • [ ] no-constant-condition
  • [ ] no-control-regex
  • [ ] no-debugger
  • [ ] no-dupe-args
  • [ ] no-dupe-else-if
  • [ ] no-dupe-keys
  • [ ] no-duplicate-case
  • [ ] no-empty
  • [ ] no-empty-character-class
  • [ ] no-ex-assign
  • [ ] no-extra-boolean-cast
  • [ ] no-extra-semi
  • [ ] no-func-assign
  • [ ] no-import-assign
  • [ ] no-inner-declarations
  • [ ] no-invalid-regexp
  • [ ] no-irregular-whitespace
  • [ ] no-misleading-character-class
  • [ ] no-obj-calls
  • [ ] no-prototype-builtins
  • [ ] no-regex-spaces
  • [ ] no-setter-return
  • [ ] no-sparse-arrays
  • [ ] no-unexpected-multiline
  • [ ] no-unreachable
  • [ ] no-unsafe-finally
  • [ ] no-unsafe-negation
  • [ ] use-isnan
  • [ ] valid-typeof

Then later we should implement the possible errors recommended rules for typescript and then the remaining recommended eslint and typescript specific rules. It would be awesome if we could have support for eslint:recommended and @typescript-eslint/recommended out of the box.

bartlomieju

comment created time in 2 days

PR opened hayd/deno-lambda

Bump to 0.38.0
+20 -22

0 comment

13 changed files

pr created time in 3 days

push eventluca-rand/deno-lambda

Luca Casonato

commit sha 29da9f8c0647514e9902e83da75560cb23101d7e

Bump to 0.38.0

view details

push time in 3 days

push eventluca-rand/deno-docker

Luca Casonato

commit sha 4becaeddf04be36cf92bea0eab77a5e6d47ef211

Last format fix

view details

push time in 3 days

push eventluca-rand/deno-docker

Luca Casonato

commit sha 8f114300d2f4a965ef813e1ab6dbd275d33a66ce

Fixed formatting more

view details

push time in 3 days

push eventluca-rand/deno-docker

Luca Casonato

commit sha 31c18964e141915d8ea1e2a0691614a5465c1806

Fixed formatting

view details

push time in 3 days

PR opened hayd/deno-docker

Bump to 0.38.0
+64 -64

0 comment

9 changed files

pr created time in 3 days

push eventluca-rand/deno-docker

Luca Casonato

commit sha 0b05abc29386092068ca5a2fd9e1f1c1183d3565

Fixed formatting change

view details

push time in 3 days

create barnchluca-rand/deno-docker

branch : bump-0.38.0

created branch time in 3 days

push eventluca-rand/deno-lambda

Luca Casonato

commit sha 16ddb4f0b6c600e19e4c86b42946eb4b9d448264

Update template.yml

view details

push time in 3 days

create barnchluca-rand/deno-lambda

branch : bump-0.38.0

created branch time in 3 days

delete branch luca-rand/deno

delete branch : colors

delete time in 3 days

push eventluca-rand/deno

Luca Casonato

commit sha 625938831a48076355681c3c178960c214e7d770

Fixed doc tests

view details

push time in 3 days

PR opened denoland/deno

Added colors to doc output

Adds basic coloring and highlighting in deno doc.

Dark background: image

Light background: image

+135 -76

0 comment

2 changed files

pr created time in 3 days

create barnchluca-rand/deno

branch : colors

created branch time in 3 days

issue openeddenoland/deno

doc should handle re exports

export { foo } from "./bar.ts" and export * from "./bar.ts"

created time in 3 days

PR opened bartlomieju/deno_doc

Reviewers
Remove rust component

Because it moved to https://github.com/denoland/deno/tree/master/cli/doc

+3 -4157

0 comment

24 changed files

pr created time in 3 days

create barnchluca-rand/deno_doc

branch : remove-rust-component

created branch time in 3 days

startedtabatkins/proposal-item-method

started time in 3 days

delete branch luca-rand/deno_doc

delete branch : remove-multipage

delete time in 3 days

push eventbartlomieju/deno_doc

Luca Casonato

commit sha 9baba8f7ad287cf138556b892a46d9a290ce6397

Remove multipage views

view details

Luca Casonato

commit sha 0cc287fb5faebf19956c4121ebdba54fd3d2968a

Merge pull request #28 from luca-rand/remove-multipage Remove multipage views

view details

push time in 3 days

PR merged bartlomieju/deno_doc

Remove multipage views

These area currently somewhat broken, don't have all of the features like type linking, and are less good than the single page view. I removed them to reduce required maintenance overhead. We can re-add them if there is demand, as the code is still available.

+37 -1355

1 comment

20 changed files

lucacasonato

pr closed time in 3 days

create barnchluca-rand/deno_doc

branch : optional-types

created branch time in 3 days

PR opened bartlomieju/deno_doc

Reviewers
Remove multipage views

These area currently somewhat broken, don't have all of the features like type linking, and are less good than the single page view. I removed them to reduce required maintenance overhead. We can re-add them if there is demand, as the code is still available.

+37 -1355

0 comment

20 changed files

pr created time in 3 days

create barnchluca-rand/deno_doc

branch : remove-multipage

created branch time in 4 days

pull request commentdenoland/deno

feat: Add "deno doc" subcommand

I just want to mention that the whole printer is still very much a first pass, there is a lot of duplicate code, and I don't like that we print straight to stdout. I will have time to change this and add proper tests for the printer next week (in another PR).

bartlomieju

comment created time in 4 days

Pull request review commentdenoland/deno

feat: Add "deno doc" subcommand

 async fn bundle_command(   bundle_result } +async fn doc_command(+  flags: Flags,+  source_file: String,+  json: bool,+  maybe_filter: Option<String>,+) -> Result<(), ErrBox> {+  let global_state = GlobalState::new(flags.clone())?;+  let module_specifier =+    ModuleSpecifier::resolve_url_or_path(&source_file).unwrap();+  let source_file = global_state+    .file_fetcher+    .fetch_source_file(&module_specifier, None)+    .await?;+  let source_code = String::from_utf8(source_file.source_code)?;++  let doc_parser = doc::DocParser::default();+  let parse_result =+    doc_parser.parse(module_specifier.to_string(), source_code);++  let doc_nodes = match parse_result {+    Ok(nodes) => nodes,+    Err(e) => {+      eprintln!("Failed to parse documentation:");+      for diagnostic in e {+        eprintln!("{}", diagnostic.message());+      }++      std::process::exit(1);+    }+  };++  if json {+    let json_string = serde_json::to_string_pretty(&doc_nodes).unwrap();+    println!("{}", json_string);+    return Ok(());+  }++  let printer = doc::TerminalPrinter::new();

I fully agree with this. I have plans to rewrite how the printer works when I do the colorization (unless someone else wants to do it). I think it would be better if it returned a tree of tokens that can be rendered in color or without into a single string.

bartlomieju

comment created time in 4 days

issue openedbartlomieju/deno_doc

Deal with overloads in CLI

Currently we just display the first one, we should display all overloads.

created time in 4 days

Pull request review commentdenoland/deno

feat: Add "deno doc" subcommand

 async fn bundle_command(   bundle_result } +async fn doc_command(+  _flags: Flags,+  source_file: String,+  json: bool,+  maybe_filter: Option<String>,+) -> Result<(), ErrBox> {+  let source_code = std::fs::read_to_string(&source_file)?;+  let doc_parser = doc::DocParser::default();+  let doc_nodes = match doc_parser.parse(source_file, source_code) {+    Ok(nodes) => nodes,+    Err(e) => {+      eprintln!("Failed to parse documentation:");

Shouldn't this say: Failed to parse source:?

bartlomieju

comment created time in 5 days

push eventluca-rand/deno_doc

Luca Casonato

commit sha 46f90ad93787cec7a1a835d57b07cd4f7ee72250

Made clippy happy

view details

push time in 5 days

push eventluca-rand/deno_doc

Luca Casonato

commit sha 95a8a25c6e25ef7f2243a96854651f6bf039fe0c

Implemented recursive search

view details

push time in 5 days

create barnchluca-rand/deno

branch : node-url

created branch time in 5 days

push eventluca-rand/deno_doc

Luca Casonato

commit sha 5e7c463902161c8e48af35e9024e77eaf92d564f

Fixed terminal ts types

view details

push time in 5 days

push eventluca-rand/deno_doc

Luca Casonato

commit sha 8f5bd8504541e091cc07eb09abc0d8d911543b00

added cards for class and namespace

view details

push time in 5 days

push eventluca-rand/deno_doc

Luca Casonato

commit sha fe6c0a76ca27f617ca04142ae3a378624f3507a4

JS Doc for details

view details

push time in 5 days

push eventluca-rand/deno_doc

Luca Casonato

commit sha 72188619298648bb2cd2bdd417946dae7e2221bc

Started on print_details

view details

push time in 5 days

push eventluca-rand/deno_doc

Luca Casonato

commit sha 187c325b2e869d217b33ec3e30322498dccb4fd5

Made things be sorted

view details

push time in 5 days

push eventluca-rand/deno_doc

Luca Casonato

commit sha 61ae4dbc857361cce1425df0e6c02b8e260b2908

Added JS Doc printing

view details

push time in 5 days

push eventluca-rand/deno_doc

Bartek Iwańczuk

commit sha 30e8e77c207a4a14dce77ddd80dfd23ead32b732

reorganize DocParser (#25) * reorganize DocParser * reorganize parsing of module body * remove snippet fields * move DocNode to separate module

view details

Luca Casonato

commit sha 75a668c03040d5ddfa11d9b5911ddac031dd3257

Merge branch 'master' of github.com:bartlomieju/deno_doc into printer

view details

push time in 6 days

push eventluca-rand/deno_doc

Luca Casonato

commit sha 80b67f34d4e3f5655669046f68d899a847ff63c1

Changed variable printing

view details

push time in 6 days

issue commentdenoland/deno

How to use env vars?

The deno namespace has moved to the Deno global. Use Deno.env()

reggi

comment created time in 6 days

Pull request review commentbartlomieju/deno_doc

Basic printing

+use crate::doc;+use crate::doc::DocNodeKind;++#[derive(Debug)]+pub struct TerminalPrinter {}++impl TerminalPrinter {+  pub fn new() -> TerminalPrinter {+    TerminalPrinter {}+  }++  pub fn print(&self, doc_nodes: Vec<doc::DocNode>) {+    for node in doc_nodes {+      match node.kind {+        DocNodeKind::Function => self.print_function(node),+        DocNodeKind::Variable => self.print_variable(node),+        DocNodeKind::Class => self.print_class(node),+        DocNodeKind::Enum => self.print_enum(node),+        DocNodeKind::Interface => self.print_interface(node),+        DocNodeKind::TypeAlias => self.print_type_alias(node),+        DocNodeKind::Namespace => self.print_namespace(node),+      }+    }+  }++  fn render_params(&self, params: Vec<doc::ParamDef>) -> String {+    let mut rendered = String::from("");+    for param in params {+      rendered.push_str(param.name.as_str());+      if param.ts_type.is_some() {+        rendered.push_str(": ");+        rendered.push_str(self.render_ts_type(param.ts_type.unwrap()).as_str());+      }+      rendered.push_str(", ");+    }+    rendered.truncate(rendered.len() - 2);+    rendered+  }++  fn render_ts_type(&self, ts_type: doc::ts_type::TsTypeDef) -> String {+    ts_type.repr+  }++  fn print_function(&self, node: doc::DocNode) {

Makes sense, but it shouldn't extend to more than JS Doc, because otherwise it might become overwhelming. Maybe even truncate down to only the first sentence and then display a .... Go also does this for the function params (displays only first 3)

lucacasonato

comment created time in 6 days

issue openedbartlomieju/deno_doc

CLI tool

Here is what I'm imagining:

deno_doc test.ts

const fizzBuzz: string
function foo(a: string, b: number): void
class Foobar
interface Reader
type NumberArray
namespace Deno

deno_doc test.ts --format json

{ ... }

deno_doc test.ts --format json --output docs.json

Places the generated json to a file at docs.json rather than to stdout

deno_doc test.ts --format html --output docs

Generates a docs folder with the precompiled React application and the generated docs.json.

--output has to be specified.

deno_doc test.ts fizzBuzz

Defined in test.ts:7:0

const fizzBuzz: string

    Something about fizzBuzz

deno_doc test.ts fizzBuzz --format json

{
    "kind": "variable",
    "name": "fizzBuzz",
    "snippet": "export const fizzBuzz: string = \"fizzBuzz\";",
    "location": { "filename": "test.ts", "line": 7, "col": 0 },
    "jsDoc": "Something about fizzBuzz",
    "variableDef": {
      "tsType": { "repr": "string", "kind": "keyword", "keyword": "string" },
      "kind": "const"
    }
}

deno_doc test.ts foo

Defined in test.ts:23:0

function foo(a: string, b: number): void

    Hello there, this is a multiline JSdoc.
    It has many lines
    Or not that many?

deno_doc test.ts Foobar

Defined in test.ts:33:0

class Foobar

    Class doc

constructor constructor(name: string)
protected protected1: number
public public1: boolean
public2: number
foo(): Promise<void>
bar(): void

deno_doc test.ts Foobar.bar

Defined in test.ts:36:0

bar(): void

    Sync bar method

ect... - the "titles" should match the titles on the webpage, and the "body" should look similar to the card content on the webpage.

Everything should be nicely colored.

This is similar to how Go displays things.

Ideas?

/cc @bartlomieju

created time in 6 days

push eventluca-rand/deno_doc

Luca Casonato

commit sha 86a8ff6a03c0d02cdbd7a86feb75624b1e52601f

Added ts_type rendering

view details

push time in 6 days

push eventluca-rand/deno_doc

Luca Casonato

commit sha 12c67d27cff4616498f0665469941fb679346592

Extract return type renderer

view details

push time in 6 days

push eventluca-rand/deno_doc

Luca Casonato

commit sha dae0306e2048d51b555bc4a8e5f78912e501c336

Added print stubs for other types

view details

push time in 6 days

Pull request review commentbartlomieju/deno_doc

Basic printing

+use crate::doc;+use crate::doc::DocNodeKind;++#[derive(Debug)]+pub struct TerminalPrinter {}++impl TerminalPrinter {+  pub fn new() -> TerminalPrinter {+    TerminalPrinter {}+  }++  pub fn print(&self, doc_nodes: Vec<doc::DocNode>) {+    for node in doc_nodes {+      match node.kind {+        DocNodeKind::Function => self.print_function(node),+        DocNodeKind::Variable => println!("A variable!"),+        DocNodeKind::Class => println!("An enum!"),+        DocNodeKind::Enum => println!("A class!"),+        DocNodeKind::Interface => println!("A class!"),+        DocNodeKind::TypeAlias => println!("A type alias!"),+        DocNodeKind::Namespace => println!("A namespace!"),+      }+    }+  }++  pub fn render_params(&self, params: Vec<doc::ParamDef>) -> String {+    let mut rendered = String::from("");+    for param in params {+      rendered.push_str(param.name.as_str());+      if param.ts_type.is_some() {+        rendered.push_str(": ");+        rendered.push_str(param.ts_type.unwrap().repr.as_str());+      }+      rendered.push_str(", ");+    }+    rendered.truncate(rendered.len() - 2);+    rendered

I can probably use iter().map() + join() here

lucacasonato

comment created time in 6 days

PR opened bartlomieju/deno_doc

Basic printing
+89 -3

0 comment

4 changed files

pr created time in 6 days

create barnchluca-rand/deno_doc

branch : printer

created branch time in 6 days

delete branch luca-rand/deno_doc

delete branch : namespace-constants

delete time in 7 days

pull request commentbartlomieju/deno_doc

Special cased constant variable namespaces

Nice, it seems JSDocs are not parsed properly for Signals

I'm using the TsType for creating this display, and that does not have JSDoc. I don't know if it makes sense to add the JSDoc onto the LiteralPropertyDef.

lucacasonato

comment created time in 7 days

PR opened bartlomieju/deno_doc

Reviewers
Special cased constant variable namespaces

Is special casing these the right thing to do here?

+123 -26

0 comment

2 changed files

pr created time in 7 days

create barnchluca-rand/deno_doc

branch : namespace-constants

created branch time in 7 days

push eventbartlomieju/deno_doc

Luca Casonato

commit sha c2ebd7ae6b9bacb08a1e4247269f71c25573eec6

Monospaced card titles

view details

push time in 7 days

delete branch luca-rand/deno_doc

delete branch : more-cards

delete time in 7 days

delete branch luca-rand/deno_doc

delete branch : extensive-tstype

delete time in 7 days

PR opened bartlomieju/deno_doc

Added more card types

Closes #8

+186 -26

0 comment

9 changed files

pr created time in 7 days

create barnchluca-rand/deno_doc

branch : more-cards

created branch time in 7 days

delete branch luca-rand/deno_doc

delete branch : refactor

delete time in 7 days

more