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

Add page for formatting customization #8868

Conversation

poorna2152
Copy link
Contributor

Purpose

Add documentation page for formatting customization.
Documentation for ballerina-platform/ballerina-lang#41280

Checklist

  • Page addition

    • Add permalink to pages.
  • Page removal

    • Remove entry from corresponding left nav YAML file.
    • Add redirect_from on the alternative page.
    • If no alternative page, add redirection on the redirections.js file.
  • Page rename

    • Add front-matter redirect_from.
    • Add front-matter redirect_to: (if applicable).
  • Page restrcuture

    • Add permalink to pages.
    • Add front-matter redirect_from.
    • Add front-matter redirect_to: (if applicable).

@poorna2152 poorna2152 changed the base branch from master to release-2201.9.0 April 5, 2024 09:26
@poorna2152 poorna2152 changed the base branch from release-2201.9.0 to master April 5, 2024 09:43
@poorna2152 poorna2152 changed the base branch from master to release-2201.9.0 April 5, 2024 09:59
{
source: `/${redirectBase}learn/customizing-formatting`,
destination: `/${redirectBase}learn/development-tutorials/source-code-dependencies/customizing-formatting`,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this add a new left nav entry as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, decided to have a separate left nav entry under source code and dependencies

#### classBraceStyle:

* Placement of the opening brace of the class definition.
* Values: NewLine, EndOfLine
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we use backticks for NewLine, EndOfLine etc? @MaryamZi

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, since these are fixed values, we should.

@sm1990
Copy link
Contributor

sm1990 commented Apr 8, 2024

@poorna2152 Please update https://github.com/ballerina-platform/ballerina-dev-website/blob/master/components/learn/boxes/Boxes.js, to list the new page in the Learn landing page.
image

Comment on lines 2 to 6
title: Customization of formatting
description: The section on providing custom configurations to the formatter.
keywords: ballerina, programming language, formatting, custom configurations
permalink: /learn/customizing-formatting/
active: customizing-formatting
Copy link
Member

Choose a reason for hiding this comment

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

Can you update these also to be consistent with the rest of these pages, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The layout section is missing here as per @sm1990, this is no longer required


If the `configPath` argument is not provided in the `Ballerina.toml` or the `Format.toml` file does not exist in the project root, default formatting options will be applied.

If the format `configPath` is an HTTP/HTTPS URL, a cache of the configuration file will be maintained inside the `target` directory. If the remote configuration file is modified, then make sure to delete the cached `Format.toml` file inside the `target/format/` directory.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If the format `configPath` is an HTTP/HTTPS URL, a cache of the configuration file will be maintained inside the `target` directory. If the remote configuration file is modified, then make sure to delete the cached `Format.toml` file inside the `target/format/` directory.
If the format `configPath` value is an HTTP/HTTPS URL, the configuration file will be cached in the `target` directory. If the remote configuration file is modified, then make sure to delete the cached `Format.toml` file inside the `target/format/` directory.

Did we discuss this user experience anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We did have a discussion on this in the earlier stages of the design and decided that it is a responsibility of the user to remove the cached file if it is updated

@anupama-pathirage anupama-pathirage merged commit ef7f50a into ballerina-platform:release-2201.9.0 Apr 29, 2024
1 check passed
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.

None yet

5 participants