PrismJS / PrismJS/prism

[Feature Request] Support for EXCEL Formula Arguments Syntax on `xlsx`

Open
#3,479 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement language-definitions
Dominant language
JavaScript
Stars
13k
Forks
1.4k
Avg merge
15h 36m
Merged PRs (30d)
3

Description

Hello friends !!!!

My FR is about a little feature to be added when using the syntax xlsx or xls .

In many cases we need to present the argument of an EXCEL formula instead of the cell.

=FORMULA(argument_1,argument_2)

=VLOOKUP(lookup_value,table_array,col_index_num, [range_lookup])

We only get syntax highlight when inserting cells

=FORMULA(A1,A2)

=VLOOKUP(A1,A2,A3,A4)

Why I am asking this ?

The Note-taking App Obsidian uses PrismJS to highlight code syntax .

I am creating a documentation about my EXCEL formula knowledge and I want to describe the formula arguments as a code block.

Suggestion of Implementation

I was talking about this idea with ganesshkumar on this Issue here

ganesshkumar suggests these approach:

Little more context, a rendered syntax like the below

image

We can see that the arguments are not wrapped inside span elements and are not annotated with classes - token, argument or text. If they can wrap the arguments in span with some css classes then we can use some custom css in obsidian to show the alternating arguments in different colors as you are expecting.

This the original comment with all the details.

I was not able to insert images in this issue (I don’t know why) but I tried the best to show my FR.


Thanks for reading this. Let me know if something is not clear.

Have a great day!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating PrismJS's xlsx/xls language definition and review the examples and discussion linked in this issue. Determine how formula arguments should be represented for syntax highlighting, then add coverage for the requested argument form and verify that existing cell-reference highlighting remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.