Coder Social home page Coder Social logo

Comments (19)

ivan-nginx avatar ivan-nginx commented on May 26, 2024

As i see u suggest 3rd variant to solve this problem, right?
And u write:

but i don't known how to merge the code in layout/_third-party/mathjax.swig, just a suggestion

So, the simplest way to modify any part of main repo code is:

  1. Do fork of main repo to your remote (and local, but not necessary) repo.
  2. U do any changes in your forked repo, this changes can be made in Github web-interface directly.
  3. After all changes, u create pull request from your remote changed repo to main repo. There will be button named «Pull request» in mainpage of your forked repo:
    image

Try it.

from hexo-theme-next.

sli1989 avatar sli1989 commented on May 26, 2024

no... i understand how to pull request, but i don't known how to debug in layout/_third-party/mathjax.swig.
just know how to solve it in next/source/js/custom.js.

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 26, 2024

So, can u step by step write how and where you do changes? And i'll try to do this.

from hexo-theme-next.

sli1989 avatar sli1989 commented on May 26, 2024

i will do my best...I'm just a layman in JS.

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 26, 2024

Ok, can u give the path to next/source/js/custom.js file?

from hexo-theme-next.

sli1989 avatar sli1989 commented on May 26, 2024

@ivan-nginx

  1. mathjax: enable: true in the theme's _config.yml,
  2. npm uninstall hexo-renderer-marked --save
  3. npm install hexo-renderer-pandoc --save
  4. Remove the if(config.template) args.push("--template=" + config.template); in hexo\node_modules\hexo-renderer-pandoc\index.js ,
  5. add mathjax in /themes/next/source/js/custom.js:
//MathJax
window.MathJax = {
    AuthorInit: function () {
      MathJax.Hub.Register.StartupHook("Begin",function () {
        MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for (i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';
      }
    });
      });
    }
  };

window.MathJax = {
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      processEscapes: true,
      skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    }
  };


//  <script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
// jQuery
$.getScript('https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML', function()
{
    // script is now loaded and executed.
    // put your dependent JS here.
});
  1. add <script type="text/javascript" src="/js/custom.js"></script> in front of /body in themes/next/layout/_layout.swig:

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 26, 2024

Ok, i see now. I just not understand what is index.js and custom.js. Awaiting for new branch.

from hexo-theme-next.

sli1989 avatar sli1989 commented on May 26, 2024

i still have no clue and have given up trying it...
haha

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 26, 2024

Please, try to change in NexT config (latest commit on this changes here):

# MathJax Support
mathjax:
  enable: false
  per_page: false
- cdn: //cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML
+ cdn: //cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML

And of course disable custom.js in _layout.swig.

Still need modify mathjax.swig?


@sli1989 if issue still exists, please:

  1. Make screens with valid and invalid looked formula.
  2. Give this formula in codeblock to explain how i can to paste it to *.md.

If u want see bugfix, i at least must to reproce it. But i don't understand this math things.

from hexo-theme-next.

sli1989 avatar sli1989 commented on May 26, 2024

it works, thank u.

# MathJax Support
mathjax:
  enable: true
  per_page: false
  cdn: //cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 26, 2024

@sli1989 really? Works in 2 variant suggested by u, right?

from hexo-theme-next.

sli1989 avatar sli1989 commented on May 26, 2024

yes, testing in NexT.Muse v6.0.0, there is no need to modify the next/source/js/custom.js and mathjax.swig.
just set the mathjax in the theme's _config.yml.

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 26, 2024

So, this issue is solved?

from hexo-theme-next.

sli1989 avatar sli1989 commented on May 26, 2024

yes, it's done. thank u.

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 26, 2024

Links on MathJax CDN in config was updated: (be3528f)

# MathJax Support
mathjax:
  enable: false
  per_page: false
  # For newMathJax CDN (cdnjs.cloudflare.com) with fallback to oldMathJax (cdn.mathjax.org).
  cdn: //cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
  # For direct link to MathJax.js with CloudFlare CDN (cdnjs.cloudflare.com).
  #cdn: //cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML
  # For automatic detect latest varsion link to MathJax.js and get from CloudFlare.
  #cdn: //cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML

from hexo-theme-next.

sli1989 avatar sli1989 commented on May 26, 2024

😲, suggest to use cdn: //cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML as default,

The MathJax CDN hosted at cdn.mathjax.org will be shutting down on April 30, 2017.

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 26, 2024

I suggest:

  1. Add //cdn.rawgit.com/mathjax/MathJax/2.7.1/MathJax.js as written in docs above.
  2. Add local copy of MathJax as 3rd-party lib extension. For that need to add separated repo.

from hexo-theme-next.

sli1989 avatar sli1989 commented on May 26, 2024

it's not working with //cdn.rawgit.com/mathjax/MathJax/2.7.1/MathJax.js.
cdn: //cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML is ok.

from hexo-theme-next.

ivan-nginx avatar ivan-nginx commented on May 26, 2024

Ok. Well, need to add local libs with separated repos. I'll do it later, after 6.0.1 release, i think.

from hexo-theme-next.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.