Code Monkey home page Code Monkey logo

vecustomsearch's Introduction

(scroll down for English)

Polski

veCustomSearch to plugin do edytora wizualnego (VisualEditor) Wikipedii. Umożliwia wstawianie zapamiętanych reguł w polach wyszukiwania i zamiany.

Domyślne reguły

Domyślnie zawiera reguły do:

  1. Poprawiania cudzysłowów na polskie.
  2. Poprawiania spacji wokół znaków przestankowych (np. "abc , def" zamieni na "abc, def").

Reguły mogą nie być idealne, ale znalezione fragmenty są podświetlane na zielono co powinno ułatwić decyzję, czy wykonać zmiany czy nie.

Sposób użycia

Na razie plugin jest w fazie alfa/beta. Docelowo za pewne będzie w Gadżetach.

  • veCustomSearch.loader.js -- to przykładowy kod, który należy wstawić do swojego vector.js. Ważne! W przykładowym kodzie należy zmienić odpowiednio URL.
  • veCustomSearch.plugin.js -- to kod pluginu, który należy wstawić do swojej przestrzeni nazw. Do tego ma prowadzić wspomniany URL.

Budowanie projektu

Instalacja webpack

Do zbudowania projektu potrzebny jest webpack. Można go zainstalować z npm:

npm install webpack -g

Teraz możesz zrobić checkout tego repozytorium (a najlepiej jego forka)...

...ale w systemie Windows możesz napotkać na parę drobnych problemów:

  1. Folder, w którym będziesz budować, nie może zawierać znaków specjalnych (w szczególności !, (, )).
  2. Folder ten nie może być także łączem typu NTFS Junction, czy innym symlinkiem.
  3. Musisz mieć ustawioną zmienną środowiskową NODE_PATH. Na Windows 7 i nowszych wystarczy odpalić setx NODE_PATH %AppData%\npm\node_modules. Może być konieczny restart, żeby wszystkie programy załapały nową zmienną.

Budowanie

Żeby zbudować wystarczy odpalić jedno polecenie:

webpack

To przetworzy pliki i utworzy nową wersję veCustomSearch.plugin.js.

Przy dłuższej pracy warto włączyć śledzenie zmian w plikach:

webpack --watch

English

veCustomSearch is a plugin for the VisualEditor of Wikipedia. It allows to restore some search-replace rules in the search form.

Default rules

Default rules are might currently be specific to Polish language, but it should be fairly easy to replace them (they are in rules.js).

Usage

For now I consider this plugin alfa or maybe beta quality.

  • veCustomSearch.loader.js -- this is an example code which you need to put in your vector.js. Note! Example code contains a plugin URL which you need to change appropriately.
  • veCustomSearch.plugin.js -- this is a pre-compiled code of this plugin. This need to go somewhere in your user namespace. The URL from modified loader snippet need to point to this.

Building this project

The webpack installation

You will need webpack to build this project. You can install it straight from npm:

npm install webpack -g

Now you can checkout this repository (or preferably it's fork)...

...but when on Windows you might stumble upon some quirks:

  1. The folder in which you run the build must not contain any special characters (!, (, ) in particular).
  2. The folder also cannot be an NTFS Junction or any other symlink.
  3. Additional NODE_PATH variable might be required. On Windows 7 and later you can simply run setx NODE_PATH %AppData%\npm\node_modules. A reboot might be required so that all programs see the new environment variable.

Running build

To build the project you can simply run:

webpack

This will compile all source files into veCustomSearch.plugin.js.

When you plan to make more changes you can start a watch process like so:

webpack --watch

vecustomsearch's People

Contributors

eccenux avatar

Watchers

James Cloos avatar  avatar  avatar

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.