inline_fn 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.idea/inline_fn.iml +72 -0
- data/.idea/modules.xml +8 -0
- data/.idea/vcs.xml +6 -0
- data/.idea/workspace.xml +188 -0
- data/.rubocop.yml +8 -2
- data/CHANGELOG.md +5 -1
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +9 -3
- data/LICENSE.txt +1 -1
- data/README.md +9 -21
- data/Rakefile +11 -3
- data/lib/inline_fn/version.rb +1 -1
- data/lib/inline_fn.rb +57 -5
- data/sig/inline_fn.rbs +4 -0
- metadata +41 -18
- data/.github/workflows/main.yml +0 -16
- data/.gitignore +0 -10
- data/Gemfile.lock +0 -40
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/inline_fn-0.1.0.gem +0 -0
- data/inline_fn.gemspec +0 -36
- data/lib/inline_fn/inline_mmd.rb +0 -29
- data/lib/inline_fn/inline_pandoc.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97196c903d4f26c43bc33c6c2879f01e04000584766f7574b8d6a50465e3f1b8
|
4
|
+
data.tar.gz: 3499746d2677a0c1038bff15fea12fdf96717c9c4b30f579fbd748c4b9e3347d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 885972e0d254e297a87867d45f99f6dfb926c1c5df388cca9ce187dc17fdb8e9510b4fb292b7363ae7d8459e8d1ee05ffe945238930f927d368f2c9bcd21df78
|
7
|
+
data.tar.gz: 934b9a12ea9d0c2cdabf108e7a4a7633a717826c5d85c9635783648b1e1f92e36e12d4b09f320764255888b126c4c3ab3a3293e37f73893cdbee08187c6ae69d
|
data/.idea/inline_fn.iml
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
4
|
+
<shared />
|
5
|
+
</component>
|
6
|
+
<component name="NewModuleRootManager">
|
7
|
+
<content url="file://$MODULE_DIR$">
|
8
|
+
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
9
|
+
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
10
|
+
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
11
|
+
</content>
|
12
|
+
<orderEntry type="jdk" jdkName="rbenv: 3.1.0" jdkType="RUBY_SDK" />
|
13
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
14
|
+
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, rbenv: 3.1.0) [gem]" level="application" />
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.3.17, rbenv: 3.1.0) [gem]" level="application" />
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="json (v2.6.2, rbenv: 3.1.0) [gem]" level="application" />
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.16.2, rbenv: 3.1.0) [gem]" level="application" />
|
18
|
+
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.22.1, rbenv: 3.1.0) [gem]" level="application" />
|
19
|
+
<orderEntry type="library" scope="PROVIDED" name="parser (v3.1.2.0, rbenv: 3.1.0) [gem]" level="application" />
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, rbenv: 3.1.0) [gem]" level="application" />
|
21
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, rbenv: 3.1.0) [gem]" level="application" />
|
22
|
+
<orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.5.0, rbenv: 3.1.0) [gem]" level="application" />
|
23
|
+
<orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, rbenv: 3.1.0) [gem]" level="application" />
|
24
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop (v1.31.2, rbenv: 3.1.0) [gem]" level="application" />
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.19.1, rbenv: 3.1.0) [gem]" level="application" />
|
26
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-minitest (v0.20.1, rbenv: 3.1.0) [gem]" level="application" />
|
27
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-rake (v0.6.0, rbenv: 3.1.0) [gem]" level="application" />
|
28
|
+
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.11.0, rbenv: 3.1.0) [gem]" level="application" />
|
29
|
+
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.2.0, rbenv: 3.1.0) [gem]" level="application" />
|
30
|
+
</component>
|
31
|
+
<component name="RakeTasksCache">
|
32
|
+
<option name="myRootTask">
|
33
|
+
<RakeTaskImpl id="rake">
|
34
|
+
<subtasks>
|
35
|
+
<RakeTaskImpl description="Build inline_fn-0.1.3.gem into the pkg directory" fullCommand="build" id="build" />
|
36
|
+
<RakeTaskImpl id="build">
|
37
|
+
<subtasks>
|
38
|
+
<RakeTaskImpl description="Generate SHA512 checksum if inline_fn-0.1.3.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
|
39
|
+
</subtasks>
|
40
|
+
</RakeTaskImpl>
|
41
|
+
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
42
|
+
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
43
|
+
<RakeTaskImpl description="Build and install inline_fn-0.1.3.gem into system gems" fullCommand="install" id="install" />
|
44
|
+
<RakeTaskImpl id="install">
|
45
|
+
<subtasks>
|
46
|
+
<RakeTaskImpl description="Build and install inline_fn-0.1.3.gem into system gems without network access" fullCommand="install:local" id="local" />
|
47
|
+
</subtasks>
|
48
|
+
</RakeTaskImpl>
|
49
|
+
<RakeTaskImpl description="Create tag v0.1.3 and build and push inline_fn-0.1.3.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
|
50
|
+
<RakeTaskImpl description="Run RuboCop" fullCommand="rubocop" id="rubocop" />
|
51
|
+
<RakeTaskImpl id="rubocop">
|
52
|
+
<subtasks>
|
53
|
+
<RakeTaskImpl description="Autocorrect RuboCop offenses (only when it's safe)" fullCommand="rubocop:autocorrect" id="autocorrect" />
|
54
|
+
<RakeTaskImpl description="Autocorrect RuboCop offenses (safe and unsafe)" fullCommand="rubocop:autocorrect_all" id="autocorrect_all" />
|
55
|
+
<RakeTaskImpl description="" fullCommand="rubocop:auto_correct" id="auto_correct" />
|
56
|
+
</subtasks>
|
57
|
+
</RakeTaskImpl>
|
58
|
+
<RakeTaskImpl description="Run tests" fullCommand="test" id="test" />
|
59
|
+
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
60
|
+
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
61
|
+
<RakeTaskImpl id="release">
|
62
|
+
<subtasks>
|
63
|
+
<RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
|
64
|
+
<RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
|
65
|
+
<RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
|
66
|
+
</subtasks>
|
67
|
+
</RakeTaskImpl>
|
68
|
+
</subtasks>
|
69
|
+
</RakeTaskImpl>
|
70
|
+
</option>
|
71
|
+
</component>
|
72
|
+
</module>
|
data/.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectModuleManager">
|
4
|
+
<modules>
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/inline_fn.iml" filepath="$PROJECT_DIR$/.idea/inline_fn.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
data/.idea/vcs.xml
ADDED
data/.idea/workspace.xml
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="AutoImportSettings">
|
4
|
+
<option name="autoReloadType" value="SELECTIVE" />
|
5
|
+
</component>
|
6
|
+
<component name="ChangeListManager">
|
7
|
+
<list default="true" id="ca42f8e7-82dc-4786-8148-99f859f55553" name="Changes" comment="2022-07-13-20-54">
|
8
|
+
<change beforePath="$PROJECT_DIR$/lib/inline_fn/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/inline_fn/version.rb" afterDir="false" />
|
9
|
+
</list>
|
10
|
+
<option name="SHOW_DIALOG" value="false" />
|
11
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
12
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
13
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
14
|
+
</component>
|
15
|
+
<component name="Git.Settings">
|
16
|
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
17
|
+
</component>
|
18
|
+
<component name="MarkdownSettingsMigration">
|
19
|
+
<option name="stateVersion" value="1" />
|
20
|
+
</component>
|
21
|
+
<component name="ProjectId" id="2BsPKJxIJhA06NV7wJGqZ9QOswL" />
|
22
|
+
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
23
|
+
<component name="ProjectViewState">
|
24
|
+
<option name="hideEmptyMiddlePackages" value="true" />
|
25
|
+
<option name="showLibraryContents" value="true" />
|
26
|
+
</component>
|
27
|
+
<component name="PropertiesComponent"><![CDATA[{
|
28
|
+
"keyToString": {
|
29
|
+
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
30
|
+
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
31
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
32
|
+
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
33
|
+
"nodejs_package_manager_path": "npm",
|
34
|
+
"ruby.rails.projectView.checked": "true",
|
35
|
+
"settings.editor.selected.configurable": "terminal"
|
36
|
+
}
|
37
|
+
}]]></component>
|
38
|
+
<component name="RunManager" selected="Test::Unit/Shoulda/Minitest.test_inline_fn_mmd">
|
39
|
+
<configuration name="inline_fn" type="RubyRunConfigurationType" factoryName="Ruby" temporary="true">
|
40
|
+
<module name="inline_fn" />
|
41
|
+
<RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="" />
|
42
|
+
<RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
43
|
+
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
|
44
|
+
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
|
45
|
+
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
|
46
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
|
47
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
48
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov" ENABLE_BRANCH_COVERAGE="true" ENABLE_FORKED_COVERAGE="true">
|
49
|
+
<COVERAGE_PATTERN ENABLED="true">
|
50
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
51
|
+
</COVERAGE_PATTERN>
|
52
|
+
</EXTENSION>
|
53
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
|
54
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$MODULE_DIR$/lib/inline_fn.rb" />
|
55
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
|
56
|
+
<method v="2" />
|
57
|
+
</configuration>
|
58
|
+
<configuration name="test_inline_fn_mmd" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true" nameIsGenerated="true">
|
59
|
+
<module name="inline_fn" />
|
60
|
+
<predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
|
61
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-Ilib:test" />
|
62
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
63
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
64
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
65
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
66
|
+
<envs>
|
67
|
+
<env name="JRUBY_OPTS" value="-X+O" />
|
68
|
+
</envs>
|
69
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
|
70
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
71
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov" ENABLE_BRANCH_COVERAGE="true" ENABLE_FORKED_COVERAGE="true">
|
72
|
+
<COVERAGE_PATTERN ENABLED="true">
|
73
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
74
|
+
</COVERAGE_PATTERN>
|
75
|
+
</EXTENSION>
|
76
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
|
77
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
78
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/test/test_inline_fn.rb" />
|
79
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPTS_PATHS" VALUE="$MODULE_DIR$/test/test_inline_fn.rb" />
|
80
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
|
81
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="^test_inline_fn_mmd$" />
|
82
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_METHOD" />
|
83
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
84
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
85
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
86
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
87
|
+
<method v="2" />
|
88
|
+
</configuration>
|
89
|
+
<configuration name="test_inline_fn_pandoc" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest" temporary="true" nameIsGenerated="true">
|
90
|
+
<module name="inline_fn" />
|
91
|
+
<predefined_log_file enabled="true" id="RUBY_TESTUNIT" />
|
92
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-Ilib:test" />
|
93
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
94
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
95
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
96
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
97
|
+
<envs>
|
98
|
+
<env name="JRUBY_OPTS" value="-X+O" />
|
99
|
+
</envs>
|
100
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
|
101
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
102
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" track_test_folders="true" runner="rcov" ENABLE_BRANCH_COVERAGE="true" ENABLE_FORKED_COVERAGE="true">
|
103
|
+
<COVERAGE_PATTERN ENABLED="true">
|
104
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
105
|
+
</COVERAGE_PATTERN>
|
106
|
+
</EXTENSION>
|
107
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
|
108
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
109
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/test/test_inline_fn.rb" />
|
110
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPTS_PATHS" VALUE="$MODULE_DIR$/test/test_inline_fn.rb" />
|
111
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="" />
|
112
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_METHOD_NAME" VALUE="^test_inline_fn_pandoc$" />
|
113
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_METHOD" />
|
114
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
115
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
116
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
117
|
+
<RTEST_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_OPTIONS" VALUE="" />
|
118
|
+
<method v="2" />
|
119
|
+
</configuration>
|
120
|
+
<recent_temporary>
|
121
|
+
<list>
|
122
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.test_inline_fn_mmd" />
|
123
|
+
<item itemvalue="Test::Unit/Shoulda/Minitest.test_inline_fn_pandoc" />
|
124
|
+
<item itemvalue="Ruby.inline_fn" />
|
125
|
+
</list>
|
126
|
+
</recent_temporary>
|
127
|
+
</component>
|
128
|
+
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
129
|
+
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" RAKE_SPRING_PRE_LOADER_OPTION="true" RAILS_SPRING_PRE_LOADER_OPTION="true" />
|
130
|
+
<component name="TaskManager">
|
131
|
+
<task active="true" id="Default" summary="Default task">
|
132
|
+
<changelist id="ca42f8e7-82dc-4786-8148-99f859f55553" name="Changes" comment="" />
|
133
|
+
<created>1657691753423</created>
|
134
|
+
<option name="number" value="Default" />
|
135
|
+
<option name="presentableId" value="Default" />
|
136
|
+
<updated>1657691753423</updated>
|
137
|
+
<workItem from="1657691754700" duration="3917000" />
|
138
|
+
</task>
|
139
|
+
<task id="LOCAL-00001" summary="initial commit">
|
140
|
+
<created>1657693651385</created>
|
141
|
+
<option name="number" value="00001" />
|
142
|
+
<option name="presentableId" value="LOCAL-00001" />
|
143
|
+
<option name="project" value="LOCAL" />
|
144
|
+
<updated>1657693651385</updated>
|
145
|
+
</task>
|
146
|
+
<task id="LOCAL-00002" summary="2022-07-13-03-31">
|
147
|
+
<created>1657693913655</created>
|
148
|
+
<option name="number" value="00002" />
|
149
|
+
<option name="presentableId" value="LOCAL-00002" />
|
150
|
+
<option name="project" value="LOCAL" />
|
151
|
+
<updated>1657693913655</updated>
|
152
|
+
</task>
|
153
|
+
<task id="LOCAL-00003" summary="2022-07-13-20-54">
|
154
|
+
<created>1657756484127</created>
|
155
|
+
<option name="number" value="00003" />
|
156
|
+
<option name="presentableId" value="LOCAL-00003" />
|
157
|
+
<option name="project" value="LOCAL" />
|
158
|
+
<updated>1657756484127</updated>
|
159
|
+
</task>
|
160
|
+
<option name="localTasksCounter" value="4" />
|
161
|
+
<servers />
|
162
|
+
</component>
|
163
|
+
<component name="TypeScriptGeneratedFilesManager">
|
164
|
+
<option name="version" value="3" />
|
165
|
+
</component>
|
166
|
+
<component name="Vcs.Log.Tabs.Properties">
|
167
|
+
<option name="TAB_STATES">
|
168
|
+
<map>
|
169
|
+
<entry key="MAIN">
|
170
|
+
<value>
|
171
|
+
<State />
|
172
|
+
</value>
|
173
|
+
</entry>
|
174
|
+
</map>
|
175
|
+
</option>
|
176
|
+
</component>
|
177
|
+
<component name="VcsManagerConfiguration">
|
178
|
+
<MESSAGE value="initial commit" />
|
179
|
+
<MESSAGE value="2022-07-13-03-31" />
|
180
|
+
<MESSAGE value="2022-07-13-20-54" />
|
181
|
+
<option name="LAST_COMMIT_MESSAGE" value="2022-07-13-20-54" />
|
182
|
+
</component>
|
183
|
+
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
184
|
+
<SUITE FILE_PATH="coverage/inline_fn@test_inline_fn_pandoc.rcov" NAME="test_inline_fn_pandoc Coverage Results" MODIFIED="1657693539353" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="inline_fn" />
|
185
|
+
<SUITE FILE_PATH="coverage/inline_fn@inline_fn.rcov" NAME="inline_fn Coverage Results" MODIFIED="1657693319814" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="inline_fn" />
|
186
|
+
<SUITE FILE_PATH="coverage/inline_fn@test_inline_fn_mmd.rcov" NAME="test_inline_fn_mmd Coverage Results" MODIFIED="1657693593278" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="inline_fn" />
|
187
|
+
</component>
|
188
|
+
</project>
|
data/.rubocop.yml
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.
|
2
|
+
TargetRubyVersion: 2.6
|
3
3
|
|
4
4
|
Style/StringLiterals:
|
5
5
|
Enabled: true
|
6
|
-
EnforcedStyle: double_quotes
|
6
|
+
# EnforcedStyle: double_quotes
|
7
7
|
|
8
8
|
Style/StringLiteralsInInterpolation:
|
9
9
|
Enabled: true
|
@@ -11,3 +11,9 @@ Style/StringLiteralsInInterpolation:
|
|
11
11
|
|
12
12
|
Layout/LineLength:
|
13
13
|
Max: 120
|
14
|
+
|
15
|
+
Metrics/MethodLength:
|
16
|
+
Max: 35
|
17
|
+
|
18
|
+
Metrics/AbcSize:
|
19
|
+
Max: 30
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
-
## [0.1.0] -
|
3
|
+
## [0.1.0] - 2022-07-13
|
4
4
|
|
5
5
|
- Initial release
|
6
|
+
|
7
|
+
# [0.1.3] - 2022-07-13
|
8
|
+
|
9
|
+
- Fixed the gem and changed method names to be more consistent. Use `text.inline_fn_mmd` for Multimarkdown style or `text.inline_fn_pandoc` for Pandoc style footnotes. There no other options for now.
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at 35749099+bcdavasconcelos@users.noreply.github.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Gemfile
CHANGED
@@ -1,10 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source
|
3
|
+
source 'https://rubygems.org'
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in inline_fn.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem
|
8
|
+
gem 'rake', '~> 13.0'
|
9
9
|
|
10
|
-
gem
|
10
|
+
gem 'minitest', '~> 5.0'
|
11
|
+
|
12
|
+
gem 'rubocop', '~> 1.21'
|
13
|
+
|
14
|
+
gem 'rubocop-minitest', '~> 0.20.1'
|
15
|
+
|
16
|
+
gem 'rubocop-rake', '~> 0.6.0'
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2022 Bernardo C.D.A. Vasconcelos
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
# InlineFn
|
2
2
|
|
3
|
-
There are two methods
|
3
|
+
There are two methods to change regular markdown footnotes to inline mmd/pandoc-style footnotes.
|
4
4
|
|
5
|
-
|
6
|
-
## MMD
|
5
|
+
## Pandoc
|
7
6
|
|
8
7
|
```ruby
|
9
8
|
#!/usr/bin/env ruby
|
@@ -11,21 +10,15 @@ There are two methods that work on strings. Use `str.inline_mmd` for Multimarkdo
|
|
11
10
|
|
12
11
|
require 'inline_fn'
|
13
12
|
|
14
|
-
|
13
|
+
str = %(Lorem ipsum dolor sit amet[^1], consectetur adipisicing elit[^2], sed...
|
15
14
|
[^1]: Text of fn 1
|
16
15
|
[^2]: Text of fn 2)
|
17
16
|
|
18
|
-
puts
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
### Expected result
|
23
|
-
|
24
|
-
```
|
25
|
-
Lorem ipsum dolor sit amet[^Text of fn 1], consectetur adipisicing elit[^Text of fn 2], sed...
|
17
|
+
puts str.inline_fn_pandoc
|
18
|
+
# Lorem ipsum dolor sit amet^[Text of fn 1], consectetur adipisicing elit^[Text of fn 2], sed...
|
26
19
|
```
|
27
20
|
|
28
|
-
##
|
21
|
+
## MMD
|
29
22
|
|
30
23
|
```ruby
|
31
24
|
#!/usr/bin/env ruby
|
@@ -33,17 +26,12 @@ Lorem ipsum dolor sit amet[^Text of fn 1], consectetur adipisicing elit[^Text of
|
|
33
26
|
|
34
27
|
require 'inline_fn'
|
35
28
|
|
36
|
-
|
29
|
+
str = %(Lorem ipsum dolor sit amet[^1], consectetur adipisicing elit[^2], sed...
|
37
30
|
[^1]: Text of fn 1
|
38
31
|
[^2]: Text of fn 2)
|
39
32
|
|
40
|
-
puts
|
41
|
-
|
42
|
-
|
43
|
-
### Expected result
|
44
|
-
|
45
|
-
```
|
46
|
-
Lorem ipsum dolor sit amet^[Text of fn 1], consectetur adipisicing elit^[Text of fn 2], sed...
|
33
|
+
puts str.inline_fn_mmd
|
34
|
+
# Lorem ipsum dolor sit amet[^Text of fn 1], consectetur adipisicing elit[^Text of fn 2], sed...
|
47
35
|
```
|
48
36
|
|
49
37
|
## Installation
|
data/Rakefile
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rake/testtask'
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << 'test'
|
8
|
+
t.libs << 'lib'
|
9
|
+
t.test_files = FileList['test/**/test_*.rb']
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'rubocop/rake_task'
|
5
13
|
|
6
14
|
RuboCop::RakeTask.new
|
7
15
|
|
8
|
-
task default:
|
16
|
+
task default: %i[test rubocop]
|
data/lib/inline_fn/version.rb
CHANGED
data/lib/inline_fn.rb
CHANGED
@@ -1,9 +1,61 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: false
|
2
2
|
|
3
|
-
require_relative
|
4
|
-
|
5
|
-
|
3
|
+
require_relative 'inline_fn/version'
|
4
|
+
|
5
|
+
# Change markdown footnotes format from `[^1]/[^1]:Note` to inline Pandoc or MMD style `^[Note]/[^Note]`.
|
6
6
|
module InlineFn
|
7
7
|
class Error < StandardError; end
|
8
|
-
|
8
|
+
|
9
|
+
def inline_fn(str, style = :pandoc)
|
10
|
+
ref_start = ''
|
11
|
+
text = str
|
12
|
+
counter = 0
|
13
|
+
|
14
|
+
until ref_start.nil?
|
15
|
+
counter += 1
|
16
|
+
cite = "[^#{counter}]"
|
17
|
+
ref = "[^#{counter}]:"
|
18
|
+
ref_start = text.index(ref)
|
19
|
+
break if ref_start.nil?
|
20
|
+
|
21
|
+
next_ref = "[^#{counter + 1}]:"
|
22
|
+
ref_end = text.index(next_ref).nil? ? -1 : text.index(next_ref) - 2
|
23
|
+
offset = counter.to_s.length + 5
|
24
|
+
note = case style
|
25
|
+
when :mmd
|
26
|
+
"[^#{text[ref_start + offset..ref_end].strip}]"
|
27
|
+
else
|
28
|
+
"^[#{text[ref_start + offset..ref_end].strip}]"
|
29
|
+
end
|
30
|
+
|
31
|
+
text = text.gsub(cite, note)
|
32
|
+
end
|
33
|
+
|
34
|
+
if counter >= 1
|
35
|
+
case style
|
36
|
+
when :mmd
|
37
|
+
text = text.gsub(/\n\s*\[\^/, "\n[^")
|
38
|
+
cut_point = text.index("\n[^")
|
39
|
+
else
|
40
|
+
text = text.gsub(/\n\s*\^\[/, "\n^[")
|
41
|
+
cut_point = text.index("\n^")
|
42
|
+
end
|
43
|
+
|
44
|
+
text = text[0, cut_point]
|
45
|
+
# puts "#{counter -= 1} notes replaced."
|
46
|
+
end
|
47
|
+
text
|
48
|
+
end
|
49
|
+
|
50
|
+
def inline_fn_pandoc
|
51
|
+
inline_fn(self, :pandoc)
|
52
|
+
end
|
53
|
+
|
54
|
+
def inline_fn_mmd
|
55
|
+
inline_fn(self, :mmd)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
class String
|
60
|
+
include InlineFn
|
9
61
|
end
|
data/sig/inline_fn.rbs
ADDED
metadata
CHANGED
@@ -1,40 +1,64 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_fn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernardo C.D.A. Vasconcelos
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
|
14
|
-
|
11
|
+
date: 2022-07-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: minitest
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '13.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '13.0'
|
41
|
+
description: Gem to convert markdown footnotes to pandoc/mmd-style inline footnotes
|
15
42
|
email:
|
16
43
|
- 35749099+bcdavasconcelos@users.noreply.github.com
|
17
44
|
executables: []
|
18
45
|
extensions: []
|
19
46
|
extra_rdoc_files: []
|
20
47
|
files:
|
21
|
-
- ".
|
22
|
-
- ".
|
48
|
+
- ".idea/inline_fn.iml"
|
49
|
+
- ".idea/modules.xml"
|
50
|
+
- ".idea/vcs.xml"
|
51
|
+
- ".idea/workspace.xml"
|
23
52
|
- ".rubocop.yml"
|
24
53
|
- CHANGELOG.md
|
54
|
+
- CODE_OF_CONDUCT.md
|
25
55
|
- Gemfile
|
26
|
-
- Gemfile.lock
|
27
56
|
- LICENSE.txt
|
28
57
|
- README.md
|
29
58
|
- Rakefile
|
30
|
-
- bin/console
|
31
|
-
- bin/setup
|
32
|
-
- inline_fn-0.1.0.gem
|
33
|
-
- inline_fn.gemspec
|
34
59
|
- lib/inline_fn.rb
|
35
|
-
- lib/inline_fn/inline_mmd.rb
|
36
|
-
- lib/inline_fn/inline_pandoc.rb
|
37
60
|
- lib/inline_fn/version.rb
|
61
|
+
- sig/inline_fn.rbs
|
38
62
|
homepage: https://github.com/bcdavasconcelos/inline_fn
|
39
63
|
licenses:
|
40
64
|
- MIT
|
@@ -50,16 +74,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
50
74
|
requirements:
|
51
75
|
- - ">="
|
52
76
|
- !ruby/object:Gem::Version
|
53
|
-
version: 2.
|
77
|
+
version: 2.6.0
|
54
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
79
|
requirements:
|
56
80
|
- - ">="
|
57
81
|
- !ruby/object:Gem::Version
|
58
82
|
version: '0'
|
59
83
|
requirements: []
|
60
|
-
rubygems_version: 3.3.
|
84
|
+
rubygems_version: 3.3.17
|
61
85
|
signing_key:
|
62
86
|
specification_version: 4
|
63
|
-
summary:
|
64
|
-
MMD style `^[Note]/[^Note]`.
|
87
|
+
summary: Inline markdown footnotes
|
65
88
|
test_files: []
|
data/.github/workflows/main.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
name: Ruby
|
2
|
-
|
3
|
-
on: [push,pull_request]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
build:
|
7
|
-
runs-on: ubuntu-latest
|
8
|
-
steps:
|
9
|
-
- uses: actions/checkout@v2
|
10
|
-
- name: Set up Ruby
|
11
|
-
uses: ruby/setup-ruby@v1
|
12
|
-
with:
|
13
|
-
ruby-version: 3.0.2
|
14
|
-
bundler-cache: true
|
15
|
-
- name: Run the default task
|
16
|
-
run: bundle exec rake
|
data/.gitignore
DELETED
data/Gemfile.lock
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
inline_fn (0.1.1)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
ast (2.4.2)
|
10
|
-
parallel (1.20.1)
|
11
|
-
parser (3.0.2.0)
|
12
|
-
ast (~> 2.4.1)
|
13
|
-
rainbow (3.0.0)
|
14
|
-
rake (13.0.6)
|
15
|
-
regexp_parser (2.1.1)
|
16
|
-
rexml (3.2.5)
|
17
|
-
rubocop (1.19.1)
|
18
|
-
parallel (~> 1.10)
|
19
|
-
parser (>= 3.0.0.0)
|
20
|
-
rainbow (>= 2.2.2, < 4.0)
|
21
|
-
regexp_parser (>= 1.8, < 3.0)
|
22
|
-
rexml
|
23
|
-
rubocop-ast (>= 1.9.1, < 2.0)
|
24
|
-
ruby-progressbar (~> 1.7)
|
25
|
-
unicode-display_width (>= 1.4.0, < 3.0)
|
26
|
-
rubocop-ast (1.11.0)
|
27
|
-
parser (>= 3.0.1.1)
|
28
|
-
ruby-progressbar (1.11.0)
|
29
|
-
unicode-display_width (2.0.0)
|
30
|
-
|
31
|
-
PLATFORMS
|
32
|
-
arm64-darwin-20
|
33
|
-
|
34
|
-
DEPENDENCIES
|
35
|
-
inline_fn!
|
36
|
-
rake (~> 13.0)
|
37
|
-
rubocop (~> 1.7)
|
38
|
-
|
39
|
-
BUNDLED WITH
|
40
|
-
2.3.0.dev
|
data/bin/console
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "bundler/setup"
|
5
|
-
require "inline_fn"
|
6
|
-
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
9
|
-
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
-
# require "pry"
|
12
|
-
# Pry.start
|
13
|
-
|
14
|
-
require "irb"
|
15
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/inline_fn-0.1.0.gem
DELETED
Binary file
|
data/inline_fn.gemspec
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "lib/inline_fn/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "inline_fn"
|
7
|
-
spec.version = InlineFn::VERSION
|
8
|
-
spec.authors = ["Bernardo C.D.A. Vasconcelos"]
|
9
|
-
spec.email = ["35749099+bcdavasconcelos@users.noreply.github.com"]
|
10
|
-
|
11
|
-
spec.summary = "Change markdown footnotes format from `[^1]/[^1]:Note` to inline Pandoc or MMD style `^[Note]/[^Note]`."
|
12
|
-
spec.description = "There are two methods that work on strings. Use `str.inline_mmd` for Multimarkdown style or `str.inline_pandoc` for Pandoc style footnotes."
|
13
|
-
spec.homepage = "https://github.com/bcdavasconcelos/inline_fn"
|
14
|
-
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = ">= 2.4.0"
|
16
|
-
|
17
|
-
|
18
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
-
spec.metadata["source_code_uri"] = "https://github.com/bcdavasconcelos/inline_fn.git"
|
20
|
-
spec.metadata["changelog_uri"] = "https://github.com/bcdavasconcelos/inline_fn/blob/master/CHANGELOG.md"
|
21
|
-
|
22
|
-
# Specify which files should be added to the gem when it is released.
|
23
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
-
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
26
|
-
end
|
27
|
-
spec.bindir = "exe"
|
28
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
29
|
-
spec.require_paths = ["lib"]
|
30
|
-
|
31
|
-
# Uncomment to register a new dependency of your gem
|
32
|
-
# spec.add_dependency "example-gem", "~> 1.0"
|
33
|
-
|
34
|
-
# For more information and examples about making a new gem, checkout our
|
35
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
36
|
-
end
|
data/lib/inline_fn/inline_mmd.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
class InlineFn
|
2
|
-
def inline_pandoc(str)
|
3
|
-
text = str
|
4
|
-
counter = 0
|
5
|
-
pandoc_mode = true
|
6
|
-
loop do
|
7
|
-
counter += 1
|
8
|
-
cite = "[^#{counter}]"
|
9
|
-
ref = "[^#{counter}]:"
|
10
|
-
ref_start = text.index(ref)
|
11
|
-
break if ref_start.nil?
|
12
|
-
|
13
|
-
next_ref = "[^#{counter + 1}]:"
|
14
|
-
ref_end = text.index(next_ref).nil? ? -1 : text.index(next_ref) - 2
|
15
|
-
offset = counter.to_s.length + 5
|
16
|
-
note = pandoc_mode ? "^[#{text[ref_start + offset..ref_end].strip}]" : "[^#{text[ref_start + offset..ref_end].strip}]"
|
17
|
-
|
18
|
-
text.gsub!(cite, note)
|
19
|
-
end
|
20
|
-
|
21
|
-
if counter >= 1
|
22
|
-
text = pandoc_mode ? text.gsub(/\n\s*\^\[/, "\n^[") : text.gsub(/\n\s*\[\^/, "\n[^")
|
23
|
-
cut_point = pandoc_mode ? text.index("\n^") : text.index("\n[^")
|
24
|
-
text = text[0, cut_point]
|
25
|
-
# puts "#{counter -= 1} notes replaced."
|
26
|
-
end
|
27
|
-
puts text
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
class InlineFn
|
2
|
-
def inline_mmd(str)
|
3
|
-
text = str
|
4
|
-
counter = 0
|
5
|
-
pandoc_mode = false
|
6
|
-
loop do
|
7
|
-
counter += 1
|
8
|
-
cite = "[^#{counter}]"
|
9
|
-
ref = "[^#{counter}]:"
|
10
|
-
ref_start = text.index(ref)
|
11
|
-
break if ref_start.nil?
|
12
|
-
|
13
|
-
next_ref = "[^#{counter + 1}]:"
|
14
|
-
ref_end = text.index(next_ref).nil? ? -1 : text.index(next_ref) - 2
|
15
|
-
offset = counter.to_s.length + 5
|
16
|
-
note = pandoc_mode ? "^[#{text[ref_start + offset..ref_end].strip}]" : "[^#{text[ref_start + offset..ref_end].strip}]"
|
17
|
-
|
18
|
-
text.gsub!(cite, note)
|
19
|
-
end
|
20
|
-
|
21
|
-
if counter >= 1
|
22
|
-
text = pandoc_mode ? text.gsub(/\n\s*\^\[/, "\n^[") : text.gsub(/\n\s*\[\^/, "\n[^")
|
23
|
-
cut_point = pandoc_mode ? text.index("\n^") : text.index("\n[^")
|
24
|
-
text = text[0, cut_point]
|
25
|
-
# puts "#{counter -= 1} notes replaced."
|
26
|
-
end
|
27
|
-
puts text
|
28
|
-
end
|
29
|
-
end
|