Comments (10)
I'm having this issue as well. I'm trying to enable syntax highlighting for Swift. I followed the instructions and added the needed config to the _app.js
file yet syntax highlighting does not work. Nor for Javascript code snippets.
Here's my _app.js
file:
import Prism from 'prism-react-renderer/prism'
;(typeof global !== 'undefined' ? global : window).Prism = Prism
require('prismjs/components/prism-swift')
import 'nextra-theme-docs/style.css'
import '../styles/globals.css'
export default function Nextra({ Component, pageProps }) {
return <Component {...pageProps} />
}
from nextra.
You may try the versions of packages used in https://github.com/shuding/site/blob/master/package.json if you cannot see the code highlighting in blog theme.
from nextra.
ive just tested with deployment on vercel and code highlighting works here, it just looks a bit odd, since nextra uses a dark backround for code / pre blocks, which makes text unreadable.
from nextra.
i trying to clone it, and when in npm run dev
code blocks dont have highlights. But, trying upload in vercel / npm run build
will has highlights, only in production
from nextra.
Interesting, Im having the same issue, just the other way around, code highlighting works on localhost (next dev and next start) but as soon as I roll it out on prod, code highlighting does not work anymore.
I am using these prism imports
https://nextra.vercel.app/docs/advanced/code-highlighting
Before code highlighting did not work at all.
from nextra.
Can't reproduce this personally, I think more insights are needed from the community. Will keep eyes open on this!
from nextra.
When I use npm install
-> npm run dev
, syntax highlighting does not work.
If I use yarn
, then it works.
from nextra.
I'm having the same issue with Swift syntax highlighting @spaceinvadev is experiencing.
from nextra.
You may try the versions of packages used in https://github.com/shuding/site/blob/master/package.json if you cannot see the code highlighting in blog theme.
This worked for me! Thank you, @suica!
from nextra.
closing since works fine in beta 2
from nextra.
Related Issues (20)
- How to write chemical equations with mhchem in LaTeX
- Favicon HOT 12
- Nextra 4 HOT 4
- Nextra with AppRouter and next-intl HOT 1
- nextra: `exports` does not export types for `.` HOT 1
- Bug: Images defined using link definitions are not loaded HOT 3
- Feature request: Vitepress-style callout markdown support HOT 3
- suggestion HOT 1
- Dark and Light mode HOT 3
- Feedback for “Callout Component”
- Feedback for “Next.js I18n”: ERR_TOO_MANY_REDIRECTS HOT 2
- Adding support for cascade layers HOT 2
- Can't resolve 'flexsearch' HOT 10
- primarySaturation is not an option anymore HOT 2
- Feedback for “Quick Start” HOT 1
- It is not possible to mark more than one identical footnote. HOT 3
- Importing components from nextra/components does not work as expected HOT 5
- [Question] Auto-closed sidebar folders HOT 6
- Can't search text from custom components HOT 14
- display:children doesn't collapse breadcrumbs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nextra.