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

Sort functions by name in documentation #470

Merged
merged 5 commits into from
Sep 23, 2024

Conversation

hdwalters
Copy link
Contributor

Fixes #460. Sorts function declarations (we expect these to be the only top level elements in the abstract syntax tree) by name. Also uses path concatenation to ensure the base directory is overwritten by an absolute output directory.

@hdwalters hdwalters force-pushed the sort-functions-by-name-in-docs branch from c507a5b to 768abf6 Compare September 9, 2024 07:40
@Mte90
Copy link
Member

Mte90 commented Sep 9, 2024

I see also a little refactoring and probably this will require that #465 to be merged before this and updated or viceversa as they are both changing the compiler.rs file.

@Mte90 Mte90 requested review from Ph0enixKM, b1ek and KrosFire September 9, 2024 08:20
@hdwalters
Copy link
Contributor Author

I see also a little refactoring and probably this will require that #465 to be merged before this and updated or viceversa as they are both changing the compiler.rs file.

Yes I see there will be merge conflicts, but not major ones. Is #465 likely to be merged any time soon?

@Mte90
Copy link
Member

Mte90 commented Sep 11, 2024

Depends if someone approves the PR...

Copy link
Member

@Ph0enixKM Ph0enixKM left a comment

Choose a reason for hiding this comment

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

Looking good. I"ll have to test it later

src/compiler.rs Show resolved Hide resolved
Copy link
Member

@Ph0enixKM Ph0enixKM left a comment

Choose a reason for hiding this comment

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

@hdwalters Tested it and it works. Found some small details that can help improve code readability!

src/modules/statement/stmt.rs Outdated Show resolved Hide resolved
src/modules/statement/stmt.rs Outdated Show resolved Hide resolved
src/modules/block.rs Outdated Show resolved Hide resolved
src/compiler.rs Show resolved Hide resolved
@Mte90 Mte90 requested review from KrosFire and Ph0enixKM September 19, 2024 08:36
@hdwalters hdwalters force-pushed the sort-functions-by-name-in-docs branch from 460c612 to 831db27 Compare September 19, 2024 16:37
@hdwalters hdwalters force-pushed the sort-functions-by-name-in-docs branch from 831db27 to d98f2af Compare September 19, 2024 16:57
Copy link
Member

@Ph0enixKM Ph0enixKM left a comment

Choose a reason for hiding this comment

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

LGTM. I didn"t test it though. Can anyone test this? I"m on vacations rn

@Mte90
Copy link
Member

Mte90 commented Sep 20, 2024

So I tested with the script on amber-lang/amber-docs#39

Tests works but:

/tmp/amber/target/debug/amber --docs "{std_path}{v}" "./docs/stdlib/doc/"

Generates:

 ERROR  Is a directory (os error 21)

@hdwalters I guess that doesn"t handle very good the output parameter

@Ph0enixKM
Copy link
Member

/tmp/amber/target/debug/amber --docs "{std_path}{v}" "./docs/stdlib/doc/"

Isn"t that incorrect @Mte90 ? shouldn"t that be "${std_path}${v}" instead if you"re running this from shell terminal?

@Mte90
Copy link
Member

Mte90 commented Sep 21, 2024

No that line is extracted from an amber script, from the PR in amber-docs about stdlib

@Ph0enixKM
Copy link
Member

@Mte90 could you then provide the entire script or at least some part of that script that shows the entire context?

@Mte90
Copy link
Member

Mte90 commented Sep 21, 2024

It was already in the comment amber-lang/amber-docs#39

@Mte90 Mte90 merged commit 2290bf3 into amber-lang:master Sep 23, 2024
1 check passed
@hdwalters hdwalters deleted the sort-functions-by-name-in-docs branch September 23, 2024 17:15
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.

[BUG] Documentation generate function sorted alphabetically
4 participants