Skip to content
This repository was archived by the owner on Jan 18, 2026. It is now read-only.

feat: remove markdown links#1004

Merged
sofisl merged 29 commits intomainfrom
removeMarkdownLinks
Oct 28, 2021
Merged

feat: remove markdown links#1004
sofisl merged 29 commits intomainfrom
removeMarkdownLinks

Conversation

@sofisl
Copy link
Contributor

@sofisl sofisl commented Oct 6, 2021

@sofisl sofisl requested a review from a team as a code owner October 6, 2021 16:42
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 6, 2021
Copy link
Contributor

@summer-ji-eng summer-ji-eng left a comment

Choose a reason for hiding this comment

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

Try to understand what's the motivation of removing the markdown. Maybe I miss something in chat.

{%- endfor -%}
{%- endmacro -%}

{%- macro markDownStuff(formattedLine) %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you rename markDownStuff to some name readable? 😆
And looks like this method has not been used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry! This was some old code I ended up deleting. Thanks for the review :)

{%- if trimmed.length > 0 %}
* {{ trimmed.replaceAll('*/', '* /') | safe }}
{%- if trimmed.length > 0 -%}
{%- set regExp = r/\[(.*?)\]\(.*?\)/g -%}
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is similar to line 32, is that possible we could reuse the regExp

@sofisl sofisl force-pushed the removeMarkdownLinks branch from f0e7546 to 2d606cb Compare October 19, 2021 23:20
@sofisl sofisl requested a review from summer-ji-eng October 20, 2021 18:56
@sofisl sofisl requested a review from bcoe October 20, 2021 18:56
@sofisl
Copy link
Contributor Author

sofisl commented Oct 20, 2021

Hey @summer-ji-eng! Thanks for the review, I ended up doing some more major changes to this PR since there were some markdowns that were left behind. The impetus for removing markdowns is in googleapis/google-cloud-node-core#594, I think it's just a preference for the generated samples since it won't actually link to anything.

Copy link

@bcoe bcoe left a comment

Choose a reason for hiding this comment

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

Left a nit, looks good to me in general though.

* "folders/[FOLDER_ID]"
* "projects/PROJECT_ID"
* "organizations/ORGANIZATION_ID"
* "billingAccounts/BILLING_ACCOUNT_ID"
Copy link

Choose a reason for hiding this comment

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

It's a little weird that we change the format of billingAccounts/[BILLING_ACCOUNT_ID] to billingAccounts/BILLING_ACCOUNT_ID, since this isn't markdown, rather it's an indicator of the value we need to replace.

This is a minor nit, because I think billingAccounts/BILLING_ACCOUNT_ID conveys the same things, "You must replace this variable".

If you decided you wanted to fix this nit, perhaps you could look at whether the [ is inside a quoted string?

Copy link
Contributor

Choose a reason for hiding this comment

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

I personally prefer to use original format quote inside of [. As developer, it is more obvious to notice the variable is need to be replace and it is different from billingAccounts.

Additionally, the original format is consistent with other languages 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.

I fixed this!

* and [Resource Name
* Format](https://cloud.google.com/asset-inventory/docs/resource-name-format)
* See Resource
* Names (https://cloud.google.com/apis/design/resource_names#full_resource_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

The link is clickable. Sorry could you remind me what is the initiative to remove the markdown links here?

See [Resource
   *  Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)

Looks better IMO.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sync offline.Sg

@sofisl sofisl force-pushed the removeMarkdownLinks branch from cc6d04e to c4d27e2 Compare October 28, 2021 00:37
@sofisl sofisl requested a review from summer-ji-eng October 28, 2021 00:42
Copy link
Contributor

@fhinkel fhinkel left a comment

Choose a reason for hiding this comment

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

LGTM. Since this is all in JS files and not in TS comments, I think it's good this way.

@sofisl sofisl merged commit 39de25d into main Oct 28, 2021
@sofisl sofisl deleted the removeMarkdownLinks branch October 28, 2021 23:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: Remove markdown links in samples/generated

4 participants